Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 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 game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions