Define a two-dimensional array for representing a tic-tac-toe board like this: +---+---+- - -+ | x | 0 | x | +-- +. | X +- The board has three rows and columns and contains strings "x", "o", and " "....


C++


Define a two-dimensional array for representing a tic-tac-toe board like this:<br>+---+---+- - -+<br>| x | 0 | x |<br>+--<br>+.<br>|<br>X<br>+-<br>The board has three rows and columns and contains strings
#include using namespace std; 3 4 const int COLS = 3; const int ROWS = 3; 7 void print(string a[][COLS], int rows); int main() { string board[ROWS][COLS] = 10 11 12 13 14 }; 15 16 print(board, ROWS); 17 return 0; } 18 19 CodeCheck Reset "/>
Extracted text: Define a two-dimensional array for representing a tic-tac-toe board like this: +---+---+- - -+ | x | 0 | x | +-- +. | X +- The board has three rows and columns and contains strings "x", "o", and " ". The print function will add the borders when printing. tictactoe.cpp 1 #include #include using namespace std; 3 4 const int COLS = 3; const int ROWS = 3; 7 void print(string a[][COLS], int rows); int main() { string board[ROWS][COLS] = 10 11 12 13 14 }; 15 16 print(board, ROWS); 17 return 0; } 18 19 CodeCheck Reset

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here