Skip to content

Instantly share code, notes, and snippets.

@duncanmak
Created February 5, 2010 23:09
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 duncanmak/296362 to your computer and use it in GitHub Desktop.
Save duncanmak/296362 to your computer and use it in GitHub Desktop.
(defn calculate-offset [value file section row column direction]
(let [tile (get-tile section row column)]
(cond
(out-of-bounds? row column) [-1 -1]
(not (false? tile)) (really-calculate-offset file (:file tile) direction)
:else
(do (Thread/sleep 60000)
(recur value file section row column direction)))))
(defn make-agent [section row column action direction]
(send-off (agent (str "Looking for " [section row column])) action row column direction))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment