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).

Order your essay today and save 50% with the discount code: MANGO

Don't use plagiarized sources. Get Your Custom Essay on
For as little as $15/Page
Order Essay

Order a unique copy of this paper

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
Top Academic Writers Ready to Help
with Your Research Proposal
Live Chat+1(978) 822-0999EmailWhatsApp

Order your essay today and save 25% with the discount code THANKYOU