SHARE
TWEET

Untitled

a guest Jul 15th, 2011 168 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn max-4-matches
  2.   [s]
  3.   (letfn [(max-4-matches*
  4.            [s c]
  5.            (cond (empty? s) c
  6.                  (or (= (nth s 0) \o)
  7.                      (= (nth s 0) \x))
  8.                  (if (= c 3)
  9.                    (+ c 1)
  10.                    #(max-4-matches* (next s) (+ c 1)))
  11.                  :else
  12.                  #(max-4-matches* (next s) 0)))]
  13.     (trampoline max-4-matches* s 0)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top