

Conway's Game of Life in Scala ( and Clojure ) - dxbydt
http://www.jasq.org/2/post/2012/08/conways-game-of-life-in-scala-repl.html

======
dkhenry
Great transliteration of the clojure code. We should try to scale it up and
see what the speed differences are.

~~~
dxbydt
Did some profiling with gliders using Conway's rules.

To compute the next generation of 100 gliders takes 480 ms To compute the next
generation of 1000 gliders takes 5 s. So, scales linearly.

    
    
        stepper( nbrs  _, List(3).contains _, List(2,3).contains _)( (1 to 1000).toList.map( x=> List((x-1,x),(x,x),(x+1,x))).flatten)
    

I guess if you replace the default collection ( List of Lists ) with a
powerful sparse double matrix (
[http://acs.lbl.gov/software/colt/api/cern/colt/matrix/impl/S...](http://acs.lbl.gov/software/colt/api/cern/colt/matrix/impl/SparseDoubleMatrix2D.html)
), you could eke out some gains...if you rewrote map and intersect and filter
and flatten and contains and...ahhh that's just too much work :)

