Skip to content

Instantly share code, notes, and snippets.

Created July 15, 2011 22:20
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 anonymous/1085679 to your computer and use it in GitHub Desktop.
Save anonymous/1085679 to your computer and use it in GitHub Desktop.
(defn generate-map
;;default remapping to inner function call
([xmax ymax] (generate-map xmax ymax xmax ymax {}))
;;default inner function call
([xmax ymax xcur ycur worldmap]
(if (and (zero? ycur) (zero? xcur)) worldmap)
(if (zero? xcur)
(recur xmax ymax xmax (dec ycur) (worldmap-add worldmap xcur ycur))
(recur xmax ymax (dec xcur) ycur (worldmap-add worldmap xcur ycur)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment