Answered step by step
Verified Expert Solution
Question
1 Approved Answer
here is the code: #include using namespace std; void printBoard(const char b[][3], const int size); void placeMove(char b[][3], int row, int col, char player); int
here is the code:
#include
void printBoard(const char b[][3], const int size); void placeMove(char b[][3], int row, int col, char player);
int main() {
/* Type your code here. */
return 0; }
5.14 LAB: 2D arrays For this lab we will be working with a 2D array of characters. A standard tic-tac-toe game can be viewed as a 3x3 2D array. First, create your 3x3 array, and fill it with spaces (remember, by default any array is full of garbage!). To see your board, create a printBoard function to print out the array with pipes (T) before and after each element of the array. (3 pts) Ex: Next, we are going to implement a (very) simple gameplay function: placeMove (1pt). This function will not do any error checking, but simply assume that good row, column, and player character data are passed to it. Your main should prompt the user for a row, column, and character. After this, you should call your placeMove function, followed by a call to printBoard. (2pts) Ex: Enter row: 1 Enter column: 2 Enter player character x or o) o For fun download your submission and modify in Code Blocks Modify to prompt users for placeMove in a loopmake it a real gameStep 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