Created
March 25, 2011 11:25
-
-
Save svdberg/886708 to your computer and use it in GitHub Desktop.
This blows the stack, how do I fix it?
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) 1) | |
this-row (+ new-row 1)] | |
(cond | |
(empty? full-list) (conj p this-row) | |
(= x 0) (path more orgmat p) | |
(= x 1) (if (>= new-row (last p)) | |
(path more orgmat p) | |
(path (reverse (nth orgmat new-row)) orgmat (conj p this-row)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment