Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1 2 3 4 5 6 1 X X X X X X 2 X X X X X X 3 X X X X X X Another array should hold

ID: 3618109 • Letter: 1

Question

   1 2 3 4 5 6

1 X X X X X X

2 X X X X X X

3 X X X X X X

Another array should hold the pairs of values and should becreated by random. The values can be any symbol you would liketo use I.E. % # & ! @ ~

There will be 9 pairs of symbols hidden in the secondarray. The player will select two options and you will comparethe symbols at those corresponding places. Each symbol will bedisplayed to the user. If they are the same, then those placeswill be empty (using a space as the character). If they aredifferent then the player presses a key to continue, after whichthey will reset to X’s. When all 9 pairs are found, thegame is over and the player has won. Use a counter to let theplayer know how many pairs where tried before the game ended.

Explanation / Answer

please rate - thanks I fully commented the code I also got rid of all getch() and the #include conio, which is thelibrary getch is in, and the system(cls). you can add themback, my compiler doesn't support clrscr(), so can't make thosechanges the getch() allows you to see the board before the screen iscleared. it waits for the input of any character #include #include using namespace std; //define so cot , dong const int COL = 6; const int ROW = 3; /** Main function Chuong tring se run function nay khi hoat dong */ int main() { //clear screen. //clrscr(); system("CLS"); // randomize(); srand(time(0)); // Khai bao bien int i, j, k, count=0,tmp; // create array two dememsion char data[ROW][COL]; char xxx[ROW][COL]; //used to create the board-which symbol has been used int used[9]={0}; //asign data (%, #, &, !, @, ~ ) vao array char keys[9]={'%','#','&','!','@','~','^','$','+'}; // create x array to be used for display for(i=0; i