Skip to content

Instantly share code, notes, and snippets.

@ibdknox ibdknox/bot.clj
Created Jul 9, 2011

Embed
What would you like to do?
bot
(defn my-bot []
(doseq [ant (my-ants)]
(let [f (closest ant (food))
food-dirs (shuffle (direction ant f))
dirs (concat food-dirs (shuffle directions))]
(when-let [dir (first (drop-while #(not (valid-move? ant %)) dirs))]
(move ant dir)))))
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.