Skip to content

Instantly share code, notes, and snippets.

@xtrntr
Last active July 15, 2016 23:28
Show Gist options
  • Save xtrntr/2f182765ba1a2b1f7c22179418e69f25 to your computer and use it in GitHub Desktop.
Save xtrntr/2f182765ba1a2b1f7c22179418e69f25 to your computer and use it in GitHub Desktop.
(defn point [n n-lst visited-n]
(let [res (for [next (map (fn [pair] (= n (first pair))) n-lst)
:when (not (some next visited-n))]
next)]
(println (some list? res))
res))
(defn walk [n1 n2 n-lst]
(loop [curr n1
visited '()]
(let [next (point curr n-lst visited)]
(cond (= curr n2) true
(not next) false
:else (recur next
(cons curr visited))))))
(def test1 '( '(a b) '(b d) '(b c)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment