Game of Life
download v1.0a (released in Dec 2000)
Description:
LIFE is a simulation game, originates from the idea proposed by a British mathematician J.H.Conway in 1970. Since its invention, LIFE has fascinated many people. For several years. There was even a quarterly newsletter devoted to related topics.
LIFE simulates the live and death of organisms. In a rectangular grid, each cell can either be occupied by an organism or not. Occupied cells are called alive; unoccupied cells are called dead. Which cells are alive changes from generation to generation according to the number of neighboring cells that are alive.
Rules of LIFE:
- The neighbors of a given cell are the eight cells that touch it vertically, horizontally, or diagonally.
- If a cell is alive but either has no neighboring cells alive or only one alive, then in the next generation the cell dies of loneliness.
- If a cell is alive and has four or more neighboring cells also alive, then in the next generation the cell dies of overcrowding.
- A living cell with either two or three living neighbors remains alive in the next generation.
- If a cell is dead, then in the next generation it will become alive if it has exactly three neighboring cells, no more or fewer, that are already alive. All other dead cells remain dead in the next generation.
- All births and deaths take place at exactly the same time, so that dying cells can help to give birth to another, but cannot prevent the death of others by reducing overcrowding, nor can cells bein born either preserve or kill cells living in the previous generation.
How to play:
LIFE is best played in full-screen DOS mode.
LIFE reads in a map file to construct an initial community of organism. It then starts the progress of generation either automatically or manually. In manual mode, press any key to change generation. In auto mode, you can pause the progress by pressing P. Pressing any other keys will return to auto progress. Quit simulation by pressing Esc.
How to make your own map files:
To create new map files, use the included function to create a blank map file first. Open BLANK.MAP by a text editor. Initially the whole file is full of dots. Each dot represents a position on the map. Add a new organism to the map by replacing a dot by a letter 'o'. When you finished editing, save the file into another name so that it will not be overwritten by another blank map.
If in doubt, use SAMPLE.MAP as an example to follow. If you accidentally spoiled SAMPLE.MAP, delete it and run LIFE again. This default map will be recreated.
Be careful in editing map files. If the format is incorrect, the program may behave abnormally or even hangup.
Features of LIFE:
- 80x50 text mode.
- Animation of birth and death.
- Configuable settings: background color, foreground color, auto or manual mode, speed.
- Built in a sample map for immediate testing. When LIFE is first run, SAMPLE.MAP will be created automatically.
- Creation of blank maps to ease editing of new maps.
Development of LIFE:
I used one day for design planning, one day to write the core engine (it is the simplest part), two to three days to write the interface, and several more days for testing, debuging and improving. Version 1.0 is finished in about one week.
Requirement:
DOS 5.0, or DOS mode in Win95 or above.
Possible improvement:
If there is time I may develop another version of LIFE for Windows.
Reference:
MARTIN GARDNER, "Mathematical Games" (regular column), Scientific American 223, no.4(October 1970), 120-123; 224, no.2(February 1971), 112-117.
MARTIN GARDNER, Wheels, Life and Other Mathematical Amusements, W.H.Freeman, New York, 1983, pp.214-257.
LIFELINE, a quartely newsletter which was published for a few years.
KRUSE/TONDO/LEUNG Data Structures & Program Design in C, 2nd Ed.