244: GOL

Conway's Game of Life

0. Come to class as there may be corrections, changes and additions.
1. Using C#, follow these directions to create a C# console program.  
2. Follow these directions to SUBMIT a folder called "GOL"
3. Follow these guidelines for readable code.
4. Review the HONESTY policy.
5. Document sources both inanimate and animate!.

GOL References
Game of Life (best)     -     Conway GOL     -     Celllular Automata     -     Life Wiki

gol   gol

Brief Video Description. Applause Required.

Requirements: ONE "deliverable" : Folder GOL

Using an OOP perspective, create a class, GOL (library dll). You will create a Program (console or windows) that will create a GOL object and use that object to demonstrate the following behaviors and capacities: Generate & display initial life grid (40x60(min)) Provide user with choice between: random grid start at least three known productive patterns Allow user to enter # of generations (1-500) and generate that number of generations following these rules: (B3/S23) For a space that is 'populated' (alive): Each cell with one or no neighbors dies Each cell with four or more neighbors dies Each cell with two or three neighbors survives For a space that is 'empty' or 'unpopulated' (dead) Each cell with exactly three neighbors becomes alive NOTE: step and compute all future settings; THEN apply future settings NOTE: There is a variation rule set called B36/S23. Could you make your code switch between rule sets? Display the generation # should at the top - change with each generation Allow to "restart" with new grid (no goto), continuation of more generations of the current grid or enter 0 to quit. Correctly generate and display each generation. Pause between generation updates to preserve the animation quality. (~20ms) System.Threading.Thread.Sleep( n ); // pause n milliseconds Use console control methods to control display making output uniform, predictable and well-behaved. A listBox with "BeginUpdate(), EndUpdate() and "Update()" can be used with windows. To Earn 100% (all above earns 90%): + Use color-coding scheme to indicate age of cells. 0 yellow 1 green 2 blue 3 magenta 4 or more red + Report stats when requested (this would be a request on the menu) # alive/dead age breakdown by category

Code and Documentation

Documentation about the game of life as a HEADER in the class - YOUR description of the game - YOUR analysis / approach / high level algorithm Every method has brief explanation Good naming & comments as neeed in code

Data Structures & Control

- 2d array of structs - minimum size: 40 rows, 60 columns - current status of cell (alive/dead) - next generation status of cell (alive/dead) - age 0 at creation +1 every generation alive upon death maintain value until re-birth A nested loop control structure will be used.


SetConsole method - set/reset console for GOL using Console Class Console.CursorVisible = _____; Console.SetWindowSize( _____, _____ ); Console.BackgroundColor = ( ConsoleColor._____ ); Console.ForegroundColor = ( ConsoleColor._____ ); Console.SetCursorPosition(_____, _____); // column, row ** ODD Console.Title = "YOUR NAME: PROJECT NAME";