This is an implementation on Conway's Game of Life: a simple mathematical game with interesting results. This game emerged from the study of cellular automata by the mathematicians Stanislaw Ulam and John von Neumann.
You can click on any cell on the life board. A white square is unoccupied, and a cell that looks like is occupied.
Here is an example of nine empty cells. If there are no cells on the board, nothing will happen.
Here is an example with five occupied cells. Following some simple mathematical rules, the next year, we will see something different.
As you should see, each cell has eight neighbors. There are only two rules to determine whether a cell will be occupied next year:
Though the two rules are simple, it is difficult to see what will happen if there are a lot of occupied cells.
Though you might not expect much to happen. Some very interesting mechanisms emerge from these simple rules, however. (For an interesting read on this topic, see Emergence by Holland.)
If nothing runs into this object, it will remain motionless for eternity, since each cell has three neighbors.
This motion will rotate every year, due to the rules. This sort of item is known as a spinner, and this is the simplest.
This item will go through several phases, then move. It will continue to move in a diagonal direction for eternity.
Note that, unless certain mechanisms emerge, the population will stabilize, meaning that no new mechanisms will appear. Conway offered a prize to the first individual to discover an exception to this, and the challenge was nearly immediately met. We find nearly all new examples today using software designed for the purpose of discovery, as newly-cataloged mechanisms are increasingly complex.
In the Game if Life, though board can extend infinitely in all directrions. In my implementation, we use an around-the-world approach: if something moves off the board in one direction, it will appear on the other side, as it had simply traveled around the world.
There are many exciting mechanisms, some so complex that they would not fit on the board I have provided.
Here are some resources with more information.