Question: CODE IN PYTHON AND MAKE THE OUTPUT EXACTLY THE SAME. There should be 5 functions including the main function. Children often play a memory game

CODE IN PYTHON AND MAKE THE OUTPUT EXACTLY THE SAME. There should be 5 functions including the main function. Children often play a memory game in which a deck of cards containing matching pairs is used.
The cards are shuffled and placed face down on a table. The players then take turns and select
two cards at a time. If both cards match, they are left face up; otherwise, the cards are placed face
down at the same positions. Once the players see the selected pair of cards and if the cards do not
match, then they can memorize the cards and use their memory to select the next pair of cards.
The game continues until all the cards are face up. Write a program to play the memory game.
Use a two-dimensional list of 4 rows and 4 columns for a deck of 16 cards with 8 matching
pairs. You can use numbers 1 to 8 to mark the cards. Use random number generators to randomly
store the pairs in the array.
Your program should consist of at least the following functions:
****
****
****
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:22
****
*8**
****
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:34
****
*8**
***1
****
Pair do not match. Select again!
****
****
****
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:12
*1**
****
****
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:34
*1**
****
***1
****
Pair match
*1**
****
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:62
Invalid position.
Enter the row (1 to 4) and col (1 to 4) position of the pair:12
Card at this position already faced up. Select position again.
Enter the row (1 to 4) and col (1 to 4) position of the pair:11
51**
****
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:13
518*
****
***1
****
Pair do not match. Select again!
*1**
****
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:13
*18*
****
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:22
*18*
*8**
***1
****
Pair match
*18*
*8**
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:14
*184
*8**
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:24
*184
*8*2
***1
****
Pair do not match. Select again!
*18*
*8**
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:21
*18*
68**
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:31
*18*
68**
7**1
****
Pair do not match. Select again!
*18*
*8**
***1
****
Enter the row (1 to 4) and col (1 to 4) position of the pair:44
*18*
*8**
***1
***2
Enter the row (1 to 4) and col (1 to 4) position of the pair:24
*18*
*8*2
***1
***2
Pair match
*18*
*8*2
***1
***2
Enter the row (1 to 4) and col (1 to 4) position of the pair:23
*18*
*832
***1
***2
Enter the row (1 to 4) and col (1 to 4) position of the pair:24
Card at this position already faced up. Select position again.
Enter the row (1 to 4) and col (1 to 4) position of the pair:33
*18*
*832
**41
***2
Pair do not match. Select again!
*18*
*8*2
***1
***2
Enter the row (1 to 4) and col (1 to 4) position of the pair:41
*18*
*8*2
***1
7**2
Enter the row (1 to 4) and col (1 to 4) position of the pair:31
*18*
*8*2
7**1
7**2
Pair match
*18*
*8*2
7**1
7**2
Enter the row (1 to 4) and col (1 to 4) position of the pair:32
*18*
*8*2
75*1
7**2
Enter the row (1 to 4) and col (1 to 4) position of the pair:42
*18*
*8*2
75*1
73*2
Pair do not match. Select again!
*18*
*8*2
7**1
7**2
Enter the row (1 to 4) and col (1 to 4) position of the pair:<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!