doesn't like override.
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
(< -1 y (count my-map)))) candidates))))
|
(< -1 y (count my-map)))) candidates))))
|
||||||
|
|
||||||
|
|
||||||
(defn resolve [came-from play-loc target-loc]
|
(defn resolve-path [came-from play-loc target-loc]
|
||||||
(if (nil? (came-from target-loc))
|
(if (nil? (came-from target-loc))
|
||||||
nil
|
nil
|
||||||
(loop [path []
|
(loop [path []
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
(let [current-loc (first (keys fronteir))]
|
(let [current-loc (first (keys fronteir))]
|
||||||
(if (or (empty? fronteir)
|
(if (or (empty? fronteir)
|
||||||
(= current-loc target-loc))
|
(= current-loc target-loc))
|
||||||
(resolve came-from play-loc target-loc)
|
(resolve-path came-from play-loc target-loc)
|
||||||
(let [neighbors (neighbors current-loc my-map)
|
(let [neighbors (neighbors current-loc my-map)
|
||||||
[cost-so-far came-from fronteir] (reduce (fn [[cost-so-far came-from fronteir] neighbor]
|
[cost-so-far came-from fronteir] (reduce (fn [[cost-so-far came-from fronteir] neighbor]
|
||||||
(let [new-cost (+ (cost-so-far current-loc) (get-in my-map (reverse neighbor)))]
|
(let [new-cost (+ (cost-so-far current-loc) (get-in my-map (reverse neighbor)))]
|
||||||
|
|||||||
Reference in New Issue
Block a user