Write a program that enables two people to play the game Concentration. In this game, 15 pairs of pictures are hidden behind a board of 30 numbered squares. The first player chooses two squares,...


Write a program that enables two people to play the game Concentration. In this game, 15 pairs of pictures are hidden behind a board of 30 numbered squares. The first player chooses two squares, revealing the figures behind them as each is chosen. If the figures match, they are removed from the board and the player gets a point and takes another turn. However, if the two figures do not match, they are hidden again and the second player takes a turn. The game ends when a player earns 8 points. Note that ties are impossible.


Let the board contain six rows and five columns of squares. Players can choose squares by either clicking buttons or entering numbers in a dialog box. For the figures, you can use colors, letters, digits, or other characters, depending on the fonts available to you.


Here are some tasks that your program must accomplish:


• Draw the closed board.


• Get 15 pairs of figures and shuffle them.


• Hide the figures behind the board.


• Keep track of the player’s turns.


• Identify chosen squares.


• Open a square to reveal its figure.


• Close a square to hide its figure and show its number again.


• Identify when two chosen figures match.


• Keep score.


• Identify when the game ends and who the winner is.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here