[Haskell-cafe] Game of life in haskell.

Lyndon Maydwell maydwell at gmail.com
Tue Feb 2 10:38:18 EST 2010


Hi Cafe.

I've made a basic game of life implementation with Haskell and OpenGL:
https://github.com/sordina/Life/

The basic premise is to generate a random snapshot, then iterate the
successor function on it to create an infinite list of snapshots, then
output them using OpenGL. I haven't really run into any major issues
aside from not being able to figure out how to automatically rerun the
display function, however I believe this is an OpenGL problem, and not
related to the Haskell side (press 'n' to move to the next snapshot
for now).

To run the game: cabal configure && cabal build &&
./dist/build/life/life <size of square life matrix>

I'm intending to improve the performance, and add more advanced
features, but I thought I'd get some feedback first. Can anyone see a
way to make this code more idiomatic, or any optimizations I might
have missed?

I'm still fairly new to Haskell and I haven't really come to grips
with monad-transformers and the like yet, so if any advanced
techniques are applicable here it would really help me link what I
think I understand to reality :-)

Also, is something like this worth uploading to Hackage, or should I
leave it on github?

Thanks guys.


More information about the Haskell-Cafe mailing list