Created
March 25, 2011 19:11
-
-
Save svdberg/887415 to your computer and use it in GitHub Desktop.
Doesnt terminate.
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
(defn path | |
[[x & more :as full-list] orgmat p] | |
(let [maxsize (count orgmat) | |
new-row (- (count more)) | |
this-row (count more)] | |
(cond | |
(empty? full-list) p | |
(= this-row 0) p | |
(= x 0) (recur more orgmat p) | |
(= x 1) (if (< new-row (last p)) | |
(recur (reverse (nth orgmat new-row)) orgmat (conj p this-row)) | |
(recur more orgmat p))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment