Skip to content

Instantly share code, notes, and snippets.

@ibdknox
Created July 9, 2011 07:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ibdknox/1073423 to your computer and use it in GitHub Desktop.
Save ibdknox/1073423 to your computer and use it in GitHub Desktop.
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