Tuesday, 1 April 2014

Conway's Game Of Life

The classic computer simulation of Conway's Game of Life, still seems to be popular with programmers. It is not so much a game as a simulation. The action takes place of a grid with a selection of them being populated with cells. The grid is then updated to the next generation of cells. Cells make it to next generation based on a few rules such as number of neighbours. New cells can also be born. End result it a captivating pattern and repeated sequences of movement that has been used to produce music and video games.

I have stumbled across (and covered in this blog) Dart versions such as this one and this one. Rosetta Code provides src to another Dart version (as well as other languages).

Background to Conway's Game of Life is covered in this wikipedia article. The original article from Scientific American can be found here.

Here's the Diving Into Dart version! Of course, it had to be colourful so cells of different ages are shaded. This still looked a bit plain so I added 4 cultures of cells to the same display. To vary things still, the number of iterations is used too and my cells are round rather than square.

Live version is here and the source is here. Have a great game of life!