SHARE
TWEET

Untitled

a guest Oct 14th, 2010 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn neighbors
  2.   ([size yx] (neighbors [[-1 0] [1 0] [0 -1] [0 1]] size yx))
  3.   ([deltas size yx]
  4.     (filter (fn [new-yx]
  5.         (every? #(< -1 % size) new-yx))
  6.       (map #(vec (map + yx %)) deltas))))
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