In the "Game of Life", there is a grid with some cells which may be alive or dead initially. Your task is to generate th
Posted: Fri Jul 01, 2022 5:53 am
question, locations beyond a 100 x 100 board should be treated as permanently dead. a.) Show how to set up a simple 2-dimensional array of boolean values to represent a Life Board in the class Gameoflife. write an initialize_board method to initialize this array randomly. [10p] b.) write a display board method which displays the board on the screen. You can use "." for the dead cells and ***** for live cells.[10p] c.) For a location (ij) on the board, write a method that will decide whether the next state of that cell should be alive or dead. Make it clear how your code copes if the cell is at the boundary of the board. [30p] d.) Referring to part), write code that takes one board representing the current state of the game and fills in a second board with the state arrived at after one time step[30 p] e.) Can you modify your solution to part (c) so that you can perform a time step using just one board. How? Provide code fragments.[20p]
In the "Game of Life", there is a grid with some cells which may be alive or dead initially. Your task is to generate the next generation of cells based on the following rules: 1. Any live cell with fewer than two live neighbors dies as if caused by underpopulation. 2. Any live cell with two or three live neighbors lives on to the next generation. 3. Any live cell with more than three live neighbors dies, as if by overpopulation. 4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction In this