Advertisement
Guest User

count-out-consecutive-short

a guest
Jan 20th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn count-out-consecutive
  2.   [matrix coords turn-vec]
  3.   (let [value (get-in matrix coords)]
  4.     (#(if (= (get-in matrix %) value)
  5.         (recur (vec (map + % turn-vec)) (inc %2))
  6.         %2
  7.       )
  8.       coords  ; dynamicly changing coords
  9.       0  ; counter
  10. )))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement