File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 101
101
still if no such move exists."
102
102
[ship destination]
103
103
(let [ship-position (:position ship)
104
- unsafe-moves (get-unsafe-moves ship-position destination)
104
+ destination-position (:position destination)
105
+ unsafe-moves (get-unsafe-moves ship-position destination-position)
105
106
dir (reduce
106
107
(fn [_ direction]
107
108
(if (is-empty?
Original file line number Diff line number Diff line change 3
3
[com.taoensso/timbre " 4.10.0" ]
4
4
[org.clojure/data.json " 0.2.6" ]]
5
5
:source-paths [" hlt/lib" " hlt/app" ]
6
+ :test-paths [" test" ]
6
7
:main MyBot
7
8
:aot [MyBot]
8
9
:uberjar-name " MyBot.jar" )
Original file line number Diff line number Diff line change
1
+ (ns hlt.game-map-test
2
+ (:require [clojure.test :refer :all ]
3
+ [hlt.ship :as ship]
4
+ [hlt.player :as player]
5
+ [hlt.shipyard :as shipyard]
6
+ [hlt.game-map :refer :all ]))
7
+
8
+ (deftest test-naive-navigate
9
+ (with-redefs [game-map (fn [] {:width 32 :height 32 })
10
+ ]
11
+ (let [ship {::ship/id 1 ::player/id 0 :position [8 10 ] :halite 100 }
12
+ shipyard {::shipyard/id -1 ::player/id 0 :position [8 16 ]}
13
+
14
+ ]
15
+ (is (= [0 1 ] (naive-navigate ship shipyard)))
16
+ )))
You can’t perform that action at this time.
0 commit comments