Created
March 25, 2011 17:30
-
-
Save svdberg/887234 to your computer and use it in GitHub Desktop.
Why does this hang/don't end?
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 test-test | |
[[x & more :as list] orgmat p] | |
(cond | |
(empty? list) p | |
(= x 1) (test-test (nth orgmat (count more)) orgmat (conj p (count more))) | |
(= x 0) (recur more orgmat p) | |
true (recur more orgmat p))) | |
orgmat is in form: | |
((0 0 0 0 0 0 0 0) (1 0 1 0 0 1 0 0) (1 0 0 0 0 1 0 0) (1 1 1 0 0 1 0 0) (1 1 1 1 0 1 0 1) (1 0 0 0 0 0 0 0) (1 1 1 1 1 1 0 1) (1 1 1 1 0 1 0 0)) | |
meaning: | |
on a one I can navigate from row-num to col num. so [7,1]=1 means row 7 can navigate to row 1. | |
Aim is to eventually find the path. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment