The objective of this task is to create a memory match game. Initially, the program will randomly assign eight image names to a 4x4 board using a two-dimensional array. Next, the program prompts the user to select two tiles, revealing them to see if they match. The player can turn over nine tiles to discover three sets of matching pictures. The user will lose the game if they cannot reveal three sets of matching pairs. As the game progresses, the program keeps track of revealed matching pictures in a vector and displays them at the end of the game. To better comprehend this game, please refer to the executable file provided with the assignment requirements. The program should have the following functions: 1- Generate a random number: generates random numbers between the minimum and maximum numbers. 2- Fill the board: Initialize the board with numbers between 1 and 16 distributed randomly. Each number minus one corresponds to the index of one of the pictures that are saved in an array. 3- Print Board: prints the board. 4- Get row: returns the row number of the board based on the tile number. 5- Get Column: returns the col number of the board based on the tile number. 6- Reveal a tile: prints the board with revealed matched picture names and currently revealed pictures. 7- Check similarity: checks if the pair of revealed pictures are identical. 8- Get valid tile number: gets the tile number from the user and checks if it is a valid number. A valid number is between 1-16 and is not revealed with a matching pair. 9- Print identical match: prints the names of the identical revealed pictures.   Use c++ and vector

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter16: Graphics
Section: Chapter Questions
Problem 3GZ
icon
Related questions
Question
  1. The objective of this task is to create a memory match game. Initially, the program will randomly assign eight image names to a 4x4 board using a two-dimensional array. Next, the program prompts the user to select two tiles, revealing them to see if they match. The player can turn over nine tiles to discover three sets of matching pictures. The user will lose the game if they cannot reveal three sets of matching pairs. As the game progresses, the program keeps track of revealed matching pictures in a vector and displays them at the end of the game.

    To better comprehend this game, please refer to the executable file provided with the assignment requirements. The program should have the following functions:

1- Generate a random number: generates random numbers between the minimum and maximum numbers.

2- Fill the board: Initialize the board with numbers between 1 and 16 distributed randomly. Each number minus one corresponds to the index of one of the pictures that are saved in an array.

3- Print Board: prints the board.

4- Get row: returns the row number of the board based on the tile number.

5- Get Column: returns the col number of the board based on the tile number.

6- Reveal a tile: prints the board with revealed matched picture names and currently revealed pictures.

7- Check similarity: checks if the pair of revealed pictures are identical.

8- Get valid tile number: gets the tile number from the user and checks if it is a valid number. A valid number is between 1-16 and is not revealed with a matching pair.

9- Print identical match: prints the names of the identical revealed pictures.

 

Use c++ and vector

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 5 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning