Question: code should be written in java In this exercise, we will create a memory game called Mind Game in this game, even number of tiles
In this exercise, we will create a memory game called "Mind Game in this game, even number of tiles are placed face-down in rows on a "Mind Game Board. Each tile contains an image. For each tile, there is exactly one other tile with the same image. The player is to pick a tile, see which image it has, and try to find its match from the remaining face-down tiles. If the player fails to turn over its match, both tiles are turned face-down and the player attempts to pick a matching pair again. The game is over when all tiles on the board are turned face-up. In this implementation of a simplified version of Mind Game, Images will be strings chosen from a FixdLenStringList. (Use the FixdLenStringList class from exercise 1 The mind game board will contain even number of Tiles. The board will be implemented as a one-dimensional array of Tiles . . For example, if the size of the mind game board is requested to be 4, then the board will have 16 tilles. The one dimension array, gameBoard, can be viewed as a 4-by-4 mind game board as ollows: gameBoa gameBoard ganeBoard[6 gameBoard[7] gameBoard8) gameBoard[9 gameBoard 10] gameBoard[11] An incomplete implementation of the Tile and Board dasses are provided with this exercise Tie java, Boord java). You should examine these classes and complete them with the folowing methods. To mplement the methods, see the specifications provided in the comments of the methods a) Write the implementation of the Board method fi11Board, which will randomly fill the mind game board with Tiles whose images (strings) are randomly chosen from the strings contained in the FixdLenStringList. A tile image that appears on the board appears exactly twice on the board b] write the implementation for the Board method lookAtTi le. Tis method will call the appropriate method of the Tile class to turn the Tile face-up. c) Write the implementation for the Board's method checkMatch. This method will check whether the tiles in its two integer parameter positions on gameBoard have the same image. If they do, the tilles will remain face-up. If they have different images, then tiles will be turned face-down (See the comments that were given in the problem specification). d) Complete the implementation for print Board sothat the Mind Game board is printed as described in the comment. For example, you should call the Board method format to right-justify the printing of the Tile image or the printing of the Tile position. An example of printBoard for a 4 by 4 mind game board that is partially solved is shown below after 4 matches have been found. The F?dLenStr ingLi t passed as a parameter to Board constructor contains strings of length 3 fox dog 10 12 13 15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
