hello, can anyone help me plz. i have an assignment to submit but i am having problem with it. the problem is just below:
the game of life
The game of life is a simple cellular automaton where the world is a 2D grid of cells which have two states: alive or dead. After each iteration, the new state of a cell is determined by the state of its neighbors at the previous iteration. This includes both the nearest neighbors and the diagonal neighbors. i.e. like a 9 point stencil without using the value of the cell itself as input. The
rules for the evolution of the system are:
• If a cell has exactly two alive neighbors, it maintains state.
• If a cell has exactly three alive neighbors, it is alive.
• Otherwise, the cell is dead.
Your code will need to:
1. Initialize the game board
2. Start loop:
a) Print the gameboard (temporarily for correctness checking)
b) Calculate number of live neighbors
c) If (live neighbors = 3) then live
d) If (live neighbors < 2) or (live neighbors > 3) then die
3. End loop
4. Print final game board (again for correctness checking)
p.s: the program should be written in C language. thnks for your corperation. plz mail me it on <Email removed by a MODERATOR. Please read our Posting Guidelines, found through the Help link at the top of your page.> as soon as possible