Skip to content

Instantly share code, notes, and snippets.

@echosa
Created March 12, 2014 14:15
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 echosa/9507809 to your computer and use it in GitHub Desktop.
Save echosa/9507809 to your computer and use it in GitHub Desktop.
This is a function I can't annotate correctly. The given annotation is how the function is currently used.
(ann zero-path-between
[(IPersistentVector (IPersistentVector Any)) Symbol (Vector* Number Number)
(Vector* Number Number)
->
(IPersistentVector (IPersistentVector Any))])
(defn zero-path-between
"Traverses the path between start and end and changes each position to 0."
[grid direction start end]
(let [next (get-next-coordinate grid start direction)]
(if (and next (not= next end))
(zero-path-between (assoc-in grid (reverse next) 0) direction next end)
grid)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment