January 2019
Intermediate to advanced
236 pages
5h 41m
English
The overall algorithm for the Game of Life is simple:
| | grid = setup() |
| | forever: |
| | new_grid = [] |
| | for cell in grid: |
| | new_grid.push(rules.apply(cell)) |
| | grid = new_grid |
You update each cell according to the rules, for as long as you want. Previously, you had a choice about when to make updates for ants, bees, and other agents. You still have that choice in a CA, however, a batch update is canonical for the Game of Life. You will, therefore, update your cells offline by making a new grid based on the rules and current grid state.
You can use asynchronous or online updates in CAs instead, by updating the current grid. You can even update the nearest neighbors of a cell rather than the whole grid. These extensions ...
Read now
Unlock full access