Question
Write a program to implement the simulation of life as described in Scientific American by Martin Gardner. The program will be implemented on a two
Write a program to implement the simulation of life as described in Scientific American by Martin Gardner. The program will be implemented on a two dimensional surface of size 60 by 60 visible elements. The rules of the simulation are as follows: 1) Aninitialsetofcellsaremarkedasalivebytheuser.Thisisgeneration0.Your program will ask the user to input a set of row and column values to let the user determine which cells are alive. Display this generation. 2) Cells change for each succeeding generation by the following rules: A living cell dies of overcrowding in the next generation if it currently has 4 or more living neighbors. A living cell dies of loneliness in the next generation if it currently has only 0 or 1 living neighbors. An empty cell becomes a birth cell (becomes alive) in the next generation if it has exactly 3 living neighbors. All other cells remain unchanged. 3) The new generation becomes the current generation and is displayed. 4) Afterdisplayingeachnewgeneration,asktheuseriftheywishtocontinuetothe next generation or stop at this point.
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