Created
March 12, 2014 14:15
-
-
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.
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
(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