|Author:||Sam Clippinger <samc (at) lookandfeel (dot) com>|
|Copyright:||©2002 lookandfeel new media|
|Current version:||184.108.40.206||Archived versions:||All versions||Documentation:||Change Log|
a game and bears no resemblance to the popular board game of the same name.
Life plays out on a grid of squares where each cell is born, lives and dies according to the number of neighbors it has. A cell's "neighbors" are the eight squares immediately adjacent to it. If a dead cell is surrounded by exactly three living neighbors, it is "born" and is considered "living" at the start of the next turn. If a living cell has two or three living neighbors, it remains "alive" at the start of the next turn. If a living cell has any other number of living neighbors, it "dies" and is considered "dead" at the start of the next turn.
Some implementations extend this idea by giving the cells ages, so they will not die immediately if abandoned or overcrowded. This implementation does not do this -- cells are bits; alive or dead. Living cells are gray, dead cells are white.
In this implementation, clicking a cell at any time will reverse its state (living cells become dead and vice-versa). The action can be started by clicking "Start" and will run until the number of remaining iterations reaches 0. An "iteration" calculates a number of rounds and updates the display to show the results. The most interactive way to run the simulation is to perform one round per iteration (the default) so the screen will update constantly. Because updating the screen is slow, more rounds can be performed between updates by increasing the number of rounds per iteration.
Note that if your screen does not update after every iteration, try setting the delay to a number greater than 0. The grid size can be increased by editing the top of the source file.