doesn't like override.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
(< -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))
|
||||
nil
|
||||
(loop [path []
|
||||
@@ -59,7 +59,7 @@
|
||||
(let [current-loc (first (keys fronteir))]
|
||||
(if (or (empty? fronteir)
|
||||
(= 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)
|
||||
[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)))]
|
||||
|
||||
Reference in New Issue
Block a user