

Show HN: Conway's Game of Life in Javascript - rrhvella
https://github.com/rrhvella/js-conways-game-of-life

======
sopooneo
The first thing I check on any Life simulation is how they handle the edges.
There are three easy ways: edges wrap, just off screen is permanently dead,
and just off screen is permanently alive. This sim uses wrap. That's how I've
always done it too.

The real way is to allow for an arbitrarily large grid off s screen. In fact,
a true implementation _requires_ that. But I can see how you might overload
the machine pretty quick when you're implementing in Javascript.

------
pavel_lishin
The ability to place pre-defined patterns with a mouse click is pretty neat. I
haven't seen many of these patterns, and have no idea what they're called.

~~~
rrhvella
Thanks. I actually took all of the patterns from the wikipedia page. You can
find the patterns and their names in the article:
[http://en.wikipedia.org/wiki/Conways_Game_of_Life#Examples_o...](http://en.wikipedia.org/wiki/Conways_Game_of_Life#Examples_of_patterns)

~~~
pavel_lishin
I don't understand the five on the right hand side, though.

~~~
rrhvella
The fifth one from the right is a spaceship and works the same way as a glider
does -- it moves to the right, instead of diagonally.

The last four are Methuselahs. They take a very long time to stabilise, and
their subsequent generations tend to cover a large area:
<http://en.wikipedia.org/wiki/Methuselah_(cellular_automata)>

