Question
Can you help me with my C++ coding? (by editing my code): I want you to create 4x7 (4 columns, 7 rows) board on C++
Can you help me with my C++ coding? (by editing my code):
I want you to create 4x7 (4 columns, 7 rows) board on C++ that all values are zero.
For example:
Then, 2 different players should be able to change the zero values as 1 or 2 (both players can use 1 and 2) and if one player tries to change already changed value or enters different value then 1 or 2, the program should warn the player.
For example:
*** The matrix board should be displayed with its final form after each player makes their move.
Here is the code I made so far, you can use it. Can you convert it into C++ language (also I believe there is a problem about entering row and columns number):
#includeusing namespace std; // function to print the board void printarray(int arr[][4]){ for (int i = 0; i > r1 >> c1; if (arr[r1][c1] != 0){ cout > val1; if (val1 != 1 && val1 != 2){ cout > r2 >> c2; if (arr[r2][c2] != 0){ cout > val2; if (val2 != 1 && val2 != 2){ cout > c; if (c == 'n'){ break; } } // Print the output cout ||0|0|0 1 0 0 0 1 |0 0 | 0 0 0 1 |0 0 1 10 0 0 0 TOTO 0 | 0 0 01 101 0 1 1 0 0 101 001 IOIOIOIO ***************** 0 1 2 3 ekil 1.a. Oyun balangc 100 0 0 0 1 0 1001 0 | 0 0 1 1000 0 1 10 01 000 0 1 1 01 | 0 | 0 | 0 1 2 OT 10 10 0 1 1 0 1 10 0 1 1 UYARI: uygunsuz giri! 10 0 | 0 TOTO 10 01 10 010 1 10 OT 10 | 0 | 0 | 0 1 100 01 10 10 100 12 10 0 1 | 110 10 011 I OTOT ** **** 0 1 2 3 1 0 1 2 3 ekil 3.a nc turda oyuncul 'in eleman girii Selil Dadamu damun leirie van
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started