October 2004
Intermediate to advanced
336 pages
6h 27m
English
This program calculates one generation in the game Life.
Life was invented by the mathematician John Conway. The game board is a two-dimensional grid, on which each cell is either occupied or not. The next generation is calculated according to the following rules:
For each cell, calculate the number of occupied neighbors from the eight possible neighbors (including diagonal neighbors).
If a cell is occupied and has two or three neighbors, it is occupied in the next generation; otherwise, it dies and is unoccupied in the next generation.
If a cell is empty and has exactly three neighbors, a new occupant is born and the ...
Read now
Unlock full access