Question: Program Conway's Game of Life using a NxN array. The starting state of the board will be determined by one of the initialization subroutines. Leave
Program Conway's Game of Life using a NxN array. The starting state of the board will be determined by one of the initialization subroutines. Leave the borders of the board empty and do not bother to update the borders of the board. A #define for N. Two arrays, one for the current board state and the other for the next board state. Store the state of each cell as an int8, dead = 0 and alive = 1. A subroutine that takes as input the current board array, a row array index, a column array index, and return the dead or alive status of that cell in the next generation. Initialize the next board array to 0. A subroutine that initializes an array with a Block (first still life) pattern near the middle of the board. A subroutine that initializes an array with a Period-2 Blinker near the middle of the board. A subroutine that initializes an array with a glider near the middle of the board. No global variables. Show that the current and next board arrays are the same at the end of the board update when the array is initialized to a Block. Do this by examining the array values for the two rows occupied by the Block. Show that the current and next board arrays show proper operation of a period-2 Blinker at the end of the board update when the array is initialized with a period-2 Blinker
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
