Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

code should be written in java In this exercise, we will create a memory game called Mind Game, ln this game, even number of tiles

code should be written in java image text in transcribed
image text in transcribed
In this exercise, we will create a memory game called "Mind Game, ln this game, even number of tiles are placed face-down in rows on a "Mind Game Boar?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 remaning facedown tiles. 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 ofTiles For example, if the size of the mind game board is requested to be 4, then the board will have 16 tiles. The one dimension array, gameBoard, can be viewed as a 4-by-4 mind game board as follows ganeBoardo gameBoard[l gameBoard[2] ganeBoard[3 ganeBoard gameBoardIS gameBoard6 gameBoard[71 ganeBoard[8 gameBoard[9] gameBoard[10] gameBoard(1 An incomplete implementation of the Tile and Board dlasses are provided with this exerdise Tile-jova, Board.java). You should examine these classes and complete them with the folowing methods. To implement the methods, see the specifications provided the comments of the methods. a) Write the implementation of the Board method i11Board which will randomly fill the mind game board with 74les whose images (strings) are randomly chosen from the strings contained in the FixdLenStringtist.A tile image that appears on the board appears exactly twice on the board b) Write the implementation for the Board method lookAtTile. This 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 checklatch. This method will check whether the tiles in its two integer parameter positions on ganeBoard have the same image. If they do, the tiles 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 printBoard so that 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 FixdLenStringlist passed as a parameter to Board constructor contains strings of length 3 dog dog Cow fox 10 14 12 13

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students explore these related Databases questions