]> git.openstreetmap.org Git - rails.git/blob - vendor/gems/rspec-1.1.2/examples/stories/game-of-life/README.txt
9624ad4118fd0dcfcf06279167f550b39c1f1dd4
[rails.git] / vendor / gems / rspec-1.1.2 / examples / stories / game-of-life / README.txt
1 John Conway's Game of Life
2
3 The Rules
4 ---------
5 The Game of Life was invented by John Conway (as you might have gathered).
6 The game is played on a field of cells, each of which has eight neighbors (adjacent cells).
7 A cell is either occupied (by an organism) or not.
8 The rules for deriving a generation from the previous one are these:
9
10 Survival
11 --------
12 If an occupied cell has 2 or 3 neighbors, the organism survives to the next generation.
13
14 Death
15 -----
16 If an occupied cell has 0, 1, 4, 5, 6, 7, or 8 occupied neighbors, the organism dies
17 (0, 1: of loneliness; 4 thru 8: of overcrowding).
18
19 Birth
20 -----
21 If an unoccupied cell has 3 occupied neighbors, it becomes occupied.