By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,191 Members | 757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,191 IT Pros & Developers. It's quick & easy.

help

P: 7
hi, i want to write the following program, so i want the ideas how must i aproach it.
the game of life is supposed to model the genetic laws for birth,survival and death. we will play the game on a board consists of 25 squares in the horizontal and vertical directions(a total of 625 squares). Each square can be empty, or it can contain an X indicating the presence of an organism. Each square(except for border squares) has eight neighbors.

the next generation of organisms is determined according the to the following criteria:
a. Birth -> an organism will be born in each empty location that has exactly 3 neighbors.
b. Death -> an organism with 4 or more organisms as neighbors will die from over crowding. An organism with fewer than two neighbors will die from loneliness.
c. Survival -> an organism with 2 or 3 neighbors will survive to the next generation.

Take an initial configuration of organisms as input data. Display the original game array, calculate the next generation in a new array, copy the new array into the original game array, and repeat the cycle for as many geanarations as you wish. Hint: Assume that the borders of the game array are infertile regions where organisms can neither survive nor born; you will not have to process the border squares.
Mar 22 '07 #1
Share this Question
Share on Google+
1 Reply


Roonie
P: 99
well, how will you store the data that you need to process?
Mar 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.