Skip to content

Instantly share code, notes, and snippets.

@edlich
Created January 24, 2013 15:17
Show Gist options
  • Save edlich/4622883 to your computer and use it in GitHub Desktop.
Save edlich/4622883 to your computer and use it in GitHub Desktop.
Second Try of a simple Tron
(defn edlTron2 [{:keys [dir togo] :or {togo 0}}]
(if (pos? togo)
{:dir dir :togo (dec togo)}
{:dir (rand-nth [:up :down :left :right])
:togo 5}))
@edlich
Copy link
Author

edlich commented Jan 24, 2013

; A third version can replace 5 with
(rand-int 10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment