I came across this a few days back when my colleague showed me this. I was really fascinated with the patterns it was generating.
So after coming from office I sat down to write it finally. Read this(http://en.wikipedia.org/wiki/Conway’s_Game_of_Life) so that you can understand it properly. Then see the demo here: http://roshansingh.in/code/gameoflife/
Keep clicking the random button, you may get to see some wonderful patterns 🙂
Find the code here: https://github.com/roshansingh/gameoflife