cellular-automaton
This is a demo that uses the cellular-automaton Node module.
This example runs the Game of Life, however, it runs it via sequential scheduling rather than the traditional parallel scheduling, so results will be different. The order in which the cells are processed here is determined by a function that sorts cells from closest to furthest to the top left.
The rules of the Game of Life
- For a space that is 'populated':
- Each cell with one or no neighbors dies, as if by solitude.
- Each cell with four or more neighbors dies, as if by overpopulation.
- Each cell with two or three neighbors survives.
- For a space that is 'empty' or 'unpopulated'
- Each cell with three neighbors becomes populated.
Legend
- Living cells are represented by circles.
- The acting cell whose rules were just evaluated will have its square highlighted in light yellow.
- Source cells for a rule application (e.g. when a cell becomes populated as a result of a certain number of neighbors, the source cells are the neighbors) are bordered in blue.
- Target cells for a rule application (e.g. when a cell dies as a result of a certain number of neighbors, the dying cell is the target) are bordered in red.