Life is a simple, yet mathematically deep, board game invented by John Conway in 1970. You may read a simple explanation of the game at http://www.math.com/students/wonders/life/life.html, and you can ``play'' some sample games at http://www.tech.org/~stuart/life/life.html.
As you will see from the above web pages, Life is played on a game board where the squares can be empty or occupied by ``cells''. At each round of the game, some cells ``die'' and some new cells are ''born.'' Each board space, x, has 8 neighbors:
+--+--+--+ | 1| 2| 3| +--+--+--+ | 4| x| 5| +--+--+--+ | 6| 7| 8| +--+--+--+The game starts with some of the spaces occupied by cells (at most one cell per space). The exact rules go as follows:
The cells' deaths and births happen simultaneously, and the rules as I have written them above try to clarify this notion by distinguishing the cells that are newly created from the cells that previously existed from the earlier round. For a careful explanation, read http://ddi.cs.uni-potsdam.de/HyFISCH/Produzieren/lis_projekt/proj_gamelife/ConwayScientificAmerican.htm.
................ ................ ................ ................ ................ ................ ................ ...XXXXXXXXXX... ................ ................ ................ ................ ................ ................ ................ ................ Rounds: 0 Dead cells: 0 Oldest living cell (in rounds): 0(This is called the ``10 Cell Row'' arrangement and produces a nontrivial repeating pattern of cells.) The dots mark empty spaces, and the Xs mark cells. The statistics at the bottom list the rounds played so far, the number of cells that have already died, and the lifespan (in rounds) of the oldest living cell still on the gameboard. After each round round of Life, the board and statistics are reprinted, like this:
................ ................ ................ ................ ................ ................ ................ and after the ................ and so on. ................ next round: ................ ................ .....XXXXXX..... ....XXXXXXXX.... ....X......X.... ....XXXXXXXX.... ...X........X... ....XXXXXXXX.... ....X......X.... ................ .....XXXXXX..... ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ ................ Rounds: 1 Rounds: 2 Dead cells: 2 Dead cells: 22 Oldest living cell (in rounds): 1 Oldest living cell (in rounds): 2
You can check whether your program is correctly calculating births and deaths of cells by comparing its behavior to the pictures above. You can also use the game board at http://www.tech.org/~stuart/life/life.html to compare, too. (Start with his empty game board, size it at 16-by-16, and place 10 cells in the center row. Then, single-step the game to see what happens.)
csc /debug+ /t:library Board.csThis generates a ``library file,'' Board.dll. You next compile Life.cs like this:
csc /debug+ /R:Board.dll Life.csand you start the simulation by typing Life.
Each time you change Board.cs you must recompile it.
Do all your work in a folder named Assign8. The folder will hold all the .cs, .dll, .pdb, and .exe files. Zip this folder and submit Assign8.zip at http://www.cis.ksu.edu/~schmidt/200s08/Assign.