Question
The original source code of the Game of Life program is provided here. Modify it so that cells die after living for 10 generations. Initial
The original source code of the Game of Life program is provided here. Modify it so that cells die after living for 10 generations. Initial age is assigned randomly as
((3+i*i+ 7*j*j)%10) for a cell at row=i and column=j. Other rules of the program remain the same. Indicate only the changes needed to the original source code.
This question is based on textbook example of "Datastructures and Program Design in C++", R. L. Kruse and A. J. Ryba.
Chapter 1, section 1.2.4 and then the class is defined in 1.4.2. and the following pages. I will include all code below
int main() II Program to play Conway's game of Life. Pre: The user supplies an initial configuration of living cells. Post: The program prints a sequence of pictures showing the changes in the configuration of living cells according to the rules for the game of Life. Uses: The class Life and its methods initialize), print), and update). The functions instructions(), user_says yes().* Life configuration; instructions() configuration.initialize): configuration.print(O: cout while (user_says_yes()) I "Continue viewing new generations?"Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started