Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bendlas/ai-challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
bolyuba committed Dec 10, 2011
2 parents f7ff0a1 + 4280315 commit 294c57e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/MyBot.clj
Expand Up @@ -3,5 +3,4 @@
(aichallenge [ant :as ant]
[bot :as bot])))

(.println *err* "Here we are")
(ant/start-game bot/init-bot)
6 changes: 6 additions & 0 deletions src/aichallenge/ant.clj
Expand Up @@ -148,6 +148,12 @@
[gs]
(:food gs))

(defn apply-move
"Get projected game state after move"
[gs [[row col :as ant] dir]]
(update-in gs [:ants]
#(-> (dissoc % [row col])
(assoc % [row col]))))

(defn unit-distance
"Get the vector distance between two points on a torus. Negative deltas are
Expand Down
1 change: 0 additions & 1 deletion src/aichallenge/bot.clj
Expand Up @@ -10,7 +10,6 @@
(perr \newline))

(defn init-bot [game-info]
(perrln "Initlializing bot")
(fn pull-moves [state]
(for [ant (:ants state)
:let [dir (first (filter #(ant/valid-move? state ant %)
Expand Down

0 comments on commit 294c57e

Please sign in to comment.