Question: C++ Having trouble with this assignment; any suggestions besides the solution posted: In this assignment, you will recreate assignment #6 (Tic Tac Toe) but with
C++
Having trouble with this assignment; any suggestions besides the solution posted:
In this assignment, you will "recreate" assignment #6 (Tic Tac Toe) but with a class/object structure. Submit your program as tictactoe2.cpp in a zip file named tictactoe2.zip You are required to use the following class definition in your program:
class TicTacToe{
public:
TicTacToe();
void play();
private:
char sigil[3];
int board[3][3];
int winner();
bool isGameOver();
void drawBoard();
bool isMoveLegal(int row, int column);
};
Your are required to use the following main function in your program:
int main(){
TicTacToe game;
game.play();
return 0;
}
You may use, if you wish, the following code for your class constructor:
TicTacToe::TicTacToe(){
for(int r=0; r<3; r++)
for (int c=0; c<3; c++)
board[r][c] = 0;
sigil[0]='.';
sigil[1]='X';
sigil[2]='O';
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
