Menu

(Solved) : Initboard0 Given Void Initboard Char Board Icols Function Initialize Game Board State Tict Q35651055 . . .

initBoard0 GIVEN: void initBoard (char board) ICOLS]) This function should initialize the game board state. tictacroe-cpp All

Complete four of the functions according to theinstructions.

initBoard0 GIVEN: void initBoard (char board) ICOLS]) This function should initialize the game board state. tictacroe-cpp All elements of the board array should be initialized with the EMPTY named constant. Do not print anything here. using nanespace atd: showBoard0 conat int ROaS-3 cor.st int COLS -3 void showBoard (char board] [COLS] const char This function should display the game board with labeled rows and columns 14 const char PLAYER X- char PLATER O Print a row with just the column numbers. .Create a double-nested for loop. Function prototypeS o For each row void initBoardl char board [ ] [COLS! ); void showboard (cbar bosrd[] [COLS void nakeHove (char board[l Icts], char player) bool gancover (char boared [1 [Cots]) Print a space, then the row letter, then the appropriate array values for that row. End with a newline makeMove(0 void makeMove (char board ICOLs,char player) Main Progra nt nain This function should input the current player’s choice, and mark it on the game board. The first parameter is the game board array, the second parameter is the player marker (either ‘x’ or ‘o) char board [ROWS] [COLSİ char carrentPlayer -PLAYER X Use a while loop to keep prompting the user until valid input is entered initBoard (board) sbowloazd (board) . The player should enter a two-character location (letter/number), for example: b2. The input should be validated (keep prompting while not valid) while (!ganeover(board)) { row must be a, b, or c ocolumn must be 1, 2, or 3 o and, the chosen location must be empty currentPlayer : (currentPlayer PLAYER X) ? PLAYER * ; PLAYER X; Once a valid location has be chosen, update the board return EXIT SUCCESS gameOver(0 bool gameOver (char board [cOLS) This predicate will examine the current state of the game board and return true if the end of the game is detected, false otherwise. If the game has ended, print one of the following messages before retuming true: . Player X wins! Player 0 wins! . Tie! Show transcribed image text

Expert Answer


Answer to Initboard0 Given Void Initboard Char Board Icols Function Initialize Game Board State Tict Q35651055 . . .

OR