Hacker News new | comments | show | ask | jobs | submit login
Conway's Game Of Life in Clojure (programmablelife.blogspot.com)
56 points by samrat 1932 days ago | hide | past | web | favorite | 11 comments



Actual author of the article here. Was really excited to see my own blog post on Hacker News, because I didn't even submit it here.

I appreciate any kind of feedback, not only for the code or the explanations but also for my blog in general, style, etc. I'm rather new to blogging. Also, feel free to ask me anything.


I found your post on Twitter and found it pretty useful, mostly because I'm reading the same book as you are(Clojure Programming) and was having some difficulty groking this program. Your post really helped.

There is a typo in line 8, I think it should have been (range h).


There was a typo indeed, thanks for pointing it out. Could you link me to that tweet?



I have to say thanks for writing this; I am starting to try and pick up Clojure at the moment, and it's always nice to see lots of different and interesting examples (see: recent 'Caves of Clojure' series that was on here)


I second this. I'm on a Clojure kick right now and am enjoying finding useful examples on HN.


Do you think this style would extend nicely to a larger 2d game? I've been trying to think more functionally when making games, but it seems like games are really just one great big ball of state.

I've seen a bunch of examples of cellular automata and, for some reason, Asteroids - but nothing "bigger". Does anyone know any nicely-written larger projects (I'd love to see a platform game) around?


Steve Losh is doing a series about making a roguelike in clojure actually- http://stevelosh.com/blog/2012/07/caves-of-clojure-01/ You might find those useful.


I'm not experienced in game developing nor am I in functional programming, but there seem to be a few things out there. What samrat said and this one (in Haskell): http://joyridelabs.de/

They are also blogging about their development.


Nice; just wrote a [fairly naive] implementation in Go myself.

It works but it's not very fast. For a 36x36 grid; I can do ~5,000 iterations in < 30 seconds or so. I'm sure a large part of the bottleneck is the fact that my "viewer" is just STDOUT redirected to a file; I want to implement some buffered I/O and then try my hand at writing HashLife.

I have to admit: I didn't think the game of life would be much of a game; but it's fairly fun to mess around with!


Would you share your Go implemenation with us? Curious about Go, too.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: