5 ms·
Show HN: Conway's Game of Life in Javascript
- pavel_lishin 14y agoThe 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 14y agoThanks. 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_of_patterns http://en.wikipedia.org/wiki/Conways_Game_of_Life#Examples_o...
- pavel_lishin 14y agoI don't understand the five on the right hand side, though.
- rrhvella 14y agoThe 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) http://en.wikipedia.org/wiki/Methuselah_(cellular_automata)
- sopooneo 14y agoThe 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.