Note
The examples shown here are generated from the source code. They therefore represent the behavior of the application at any times. Non regression is ensured by checking the absence of change in this document. Learn more here https://github.com/sfauvel/documentationtesting

View source of project on Github

Game of life rules

Rules

At each step in time, the following transitions occur:

  1. Any live cell with 0, 1 live neighbours dies, as if by underpopulation.

  2. Any live cell with 2, 3 live neighbours lives on to the next generation.

  3. Any live cell with 4, 5, 6, 9 live neighbours dies, as if by overpopulation.

  4. Any dead cell with 3 live neighbours , becomes a live cell as if by reproduction.

  5. Any dead cell with 2, 4 live neighbours stayed a dead cell.

Game of life illustrated by examples

Die when less than 2 neighbours

With less than 2 neighbours, cell die on the next generation.

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

Stay alive when 2 neighbours

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

Becomes alive when 3 neighbours

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*

*