Children often play memory game in which the deck of cards containing matching pairs is used. Cards are shuffled and placed face down on a table. Players then take turns and choose 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 selected pair of cards and if the cards don’t match, then they could memorize the cards and use their memory to choose the next pair of cards. The game continues until all cards are face up.
problem 1) prepare a program to play memory game. Use two dimensional array of 4 rows and 4 columns to use a deck of 16 cards with 8 matching pairs and you can use numbers 1 to 8 to mark the cards. (If you use a 6 by 6 array, then you will need 18 matching pairs, and so on.) Use random number generators to randomly store the pairs in the array. Use suitable functions in your program, and the main program must be merely a call to functions.