Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

GAME OF LIFE PART 2 C++ : NEED THE CODE TO OBTAIN THIS The game of life belongs

ID: 3683920 • Letter: G

Question

GAME OF LIFE PART 2 C++: NEED THE CODE TO OBTAIN THIS

The game of life belongs to a class called “Cellular Automata”. It is a simulation of biological survival and growth.

The rules are simple

The game is played on a rectangular grid of any size.

The game consists of cycles

At each cycle of the game, every cell on the grid is either alive, “1”, or dead, “0”.

In the 0 cycle a starting pattern is generated.

At each subsequent cycle the pattern is evolved according to the rules.

The state of a cell may change from cycle to cycle depending on the population of the 8 adjacent cells.

If a cell is dead, “0” and exactly three of its closest 8-neighbors are alive, “1”, in the current cycle, then the cell will be born, “1”, in the next cycle.

If a cell is alive, “1” in the current cycle, and either 2 or 3 of its neighbors are alive it will survive, “1”, into the next cycle.

In all other cases, the cell dies “0” in the next cycle.

The game continues for as long as the user chooses to run the cycling.

Some patterns grow, some are stable, and some die off over time.

You will display the current state at each cycle by printing spaces for dead cells and a character for live cells in the corresponding positions on your display.

Solving the problem requires 2 arrays, one to calculate the next state and one to hold and display the current state. During recalculation, the calculation array accepts the next state information. Once the calculation of the entire array is complete, the calculation array is copied to the display array and the new state is printed to the screen along with a fill percentage, a cycle count, and a signature.

Part 2

Load a pattern from a supplied file and write it into your display array

Display and save the output screen

Run the update function for 120 cycles and save the resulting output screen.

Glider Gun file data:

Explanation / Answer

i can do this. can you explain the data file. thanks