Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
(defn simple-bot []
(let [state *game-state*]
(reduce (fn [state ant]
(binding [*game-state* state]
(when-let [dir (rand-nth (filter #(unoccupied?
(can-move? ant %))
(let [new-pos (move-ant ant dir)]
(move ant dir) ; send actual command
(update-in state [:ants] #(-> % ; update state
(disj ant)
(conj new-pos)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.