Objective : To program a simple LIFE game (credits: John Conway, original concept). Lots of these are on the web if you do a Google search.
Concepts: Control Arrays, Defensive Design
Rules:
(birth) an unpopulated cell has exactly 3 neighbors, so there is a birth in the unpopulated cell
(death by loneliness) a populated cell has fewer than (but not equal to) 2 neighbors, so it dies
(death by overpopulation) a populated cell has greater than (but not equal to) 3 neighbors, so it dies.
Big Concept:
all rules are "seemingly" applied to all the cells simultaneously (which really means you need to use 2 arrays; one that has the exact current "generation", and the other which receives, cell-cell) the results of the rules being applied to the cells in the first array. CLICK THE IMAGE BELOW TO RUN A SAMPLE VERSION.
By appropriate use of the .enable property for command buttons, your code should, at the appropriate times, disable and then enable specific buttons from being clicked. No, you don't have to really deal with much input from the keyboard … concentrate primarily on the code that will be invoked when someone clicks on one of the buttons that causes a new generation to be found.
Design - A simple design document MUST accompany the program. You do NOT have to go wild! Simply, try to write enough so that if you didn't see the program for a year, you could read this document and feel comfortable about making additions to the program.
Testing: Try your program out testing "edge" conditions (cells in the first and last row, cells in the first and last column). Don't test for cell that doesn't exist, and don't generate an invalid set of indexes into the array(s).
Extra Credit - Allow the user to select from a set of patterns to start a run, e.g. straight line, criss-cross, creepers, etc.
Due: 2 Weeks ( Tue Feb 23 ) ; Live presentation in front of class. Must present & compile the code.