Skip to content

Instantly share code, notes, and snippets.

@sritchie sritchie/recur.clj
Created Jul 15, 2011

Embed
What would you like to do?
(defn max-4-matches [s]
(loop [check s, matches 0]
(if (or (= 4 matches) (empty? check))
matches
(recur (rest check)
(if (#{\o \x} (first check))
(inc matches)
matches)))))
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.