Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

GameOfLife Class You need to code this class. The following is a suggested list of instance variables and methods for the class. It's only a...

GameOfLife ClassYou need to code this class. The following is a suggested list of instance variables and methods for the class. It’s only a suggestion.Instance variables: grid: Grid cells: boolean [ ][ ] current state of the game size: int size of grid in pixels cols: int number of rows and columns of grid and cellsMethods: GameOfLife(initSize: int, initCols: int)o Constructor. Use input parameters to initialise instance variables. A Grid and Boolean array will need to be instantiated. reInitCells(updateCells: Boolean [ ][ ]): voido Completely overwrite the elements of the array cells with those of the supplied array parameter (updateCells)o This allows the game to restart with a new initial pattern of grid cells doStep(): voido This processes the elements of the array called cells to set the elements of a new array that contains the state of the game at the next stepo The new array is then used to update the displayed grid (using the Grid class’s update method)o Finally the elements of the cells array are updated with the new array’s elements ready to begin the next call of doStep()o You may need to code and call one or more other methods from this method to simplify the coding tasko You should implement a wrapped grid/array so that the grid is finite but without boundaries. To do this: when processing the array treat its top row as being next to its bottom row and its leftmost column as being next to its rightmost column. If you are geometrically inclined this turns the flat grid into a torus (doughnut shape).

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question