Just because there is always another way :P

(defn determine-new-state [x y]
  (let [alive (count (for [dx [-1 0 1] dy [-1 0 1]
                           :when (cells [(+ x dx) (+ y dy)])]
                       :alive))]
    (if (cells [x y])
      (< 2 alive 5)
      (= alive 3))))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to