On Tue, Mar 3, 2009 at 2:03 PM, lps540 <[email protected]> wrote:
>
> I've written a small example of Conway's Game of Life using Clojure
> and Swing. Comments/critiques are welcome.
>
> http://lpsherrill.blogspot.com/2009/02/conways-game-of-life.html
The paint-cells function can be shorted by using doseq and destructuring.
(defn paint-cells [graphics]
(doseq [[[x, y] state] @cells]
(doto graphics
(.setColor (if state Color/RED Color/WHITE))
(.fillRect (* 10 x) (* 10 y) 10 10))))
--
R. Mark Volkmann
Object Computing, Inc.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---