Created
July 9, 2011 07:47
-
-
Save ibdknox/1073423 to your computer and use it in GitHub Desktop.
bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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