Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Why doesn't this loop work appropriately?
solver.clj:
Skip this column value
solver.clj:
The collection vector
solver.clj:
[]
solver.clj:
The part vector
solver.clj:
nil
solver.clj:
Skip this column value
solver.clj:
The collection vector
solver.clj:
[nil]
solver.clj:
The part vector
solver.clj:
nil
solver.clj:
Skip this column value
solver.clj:
The collection vector
solver.clj:
[nil nil]
solver.clj:
The part vector
solver.clj:
nil
solver.clj:
Skip this column value
solver.clj:
The collection vector
solver.clj:
[nil nil nil]
solver.clj:
The part vector
solver.clj:
nil
solver.clj:
This is the collection-vector from the function.
solver.clj:
[nil nil nil nil]
(defn return-part-vector [column-count current-row j]
(loop [ part-vector [] k 0]
(if (< k column-count)
(if (not= j k)
(let [current-column (nth current-row k)]
(recur (conj part-vector current-column) (inc k))))
(println "Do nothing")
part-vector)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.