Game of Life
The Game of Life is a cellular automaton that models a population of living organisms living on a two-dimensional plane subdivided into squares. One cell may live in each square. John Horton Conway set down the rules of the game in Scientific American:
- 1.
If a cell has less than two neighbors alive in any of the eight adjacent squares (those immediately above and below, left and right, and those that touch corners diagonally), it dies.
- 2.
But if it has more than three live neighbors, it also dies.
- 3.
Having two or three neighbors, a cell lives on to the next generation.
- 4.
If an empty square has exactly three neighbors, a new cell is born there.
The rules are repeatedly applied, and one of two kinds of outcomes are possible: the entire population could die out, or the population settles into a periodic pattern that can go on infinitely.