openstreetmap-website/vendor/gems/rspec-1.1.2/examples/stories/game-of-life
2008-01-22 16:39:09 +00:00
..
behaviour added RSpec and RSpec on Rails 2008-01-22 16:39:09 +00:00
life added RSpec and RSpec on Rails 2008-01-22 16:39:09 +00:00
life.rb added RSpec and RSpec on Rails 2008-01-22 16:39:09 +00:00
README.txt added RSpec and RSpec on Rails 2008-01-22 16:39:09 +00:00

John Conway's Game of Life

The Rules
---------
The Game of Life was invented by John Conway (as you might have gathered).
The game is played on a field of cells, each of which has eight neighbors (adjacent cells).
A cell is either occupied (by an organism) or not.
The rules for deriving a generation from the previous one are these:

Survival
--------
If an occupied cell has 2 or 3 neighbors, the organism survives to the next generation.

Death
-----
If an occupied cell has 0, 1, 4, 5, 6, 7, or 8 occupied neighbors, the organism dies
(0, 1: of loneliness; 4 thru 8: of overcrowding).

Birth
-----
If an unoccupied cell has 3 occupied neighbors, it becomes occupied.