Permalink
Browse files

Use "inc" and "dec" for clarity

  • Loading branch information...
1 parent 769281d commit 5f2bff6522f755fc2cd9e8dc1ea8f4dd03e17542 @bruceadams committed May 6, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 clojure/src/life/core.clj
@@ -21,8 +21,8 @@
(defn neighborhood [p]
"Return the set of cell coordinates of the Moore neighbors of the
given cell."
- (difference (set (for [x (range (- (first p) 1) (+ (first p) 2))
- y (range (- (last p) 1) (+ (last p) 2))]
+ (difference (set (for [x (range (dec (first p)) (inc (inc (first p))))
+ y (range (dec (last p)) (inc (inc (last p))))]
[x y]))
#{p}))

0 comments on commit 5f2bff6

Please sign in to comment.