Advertisement
Guest User

count-out-consecutive

a guest
Jan 20th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn count-out-consecutive
  2.   ([count]
  3.     count)
  4.   ([matrix [x y] turn-vec]
  5.     (count-out-consecutive matrix [x y] turn-vec ((matrix y) x) 0))
  6.   ([matrix [x y] turn-vec value count]
  7.     (if (= (get (get matrix y) x) value)
  8.       (recur matrix
  9.              [(+ x (turn-vec 0)) (+ y (turn-vec 1))]
  10.              turn-vec value
  11.              (inc count))
  12.       (count-out-consecutive count)
  13.     )
  14.   )
  15. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement