Question: why int this code running? Id appreciate a comment on the location of the error. #include using namespace std; class TicTacToe { public: TicTacToe (
why int this code running? Id appreciate a comment on the location of the error.
#include
using namespace std;
class TicTacToe
public:
TicTacToe
forint i ; i ; i
forint j ; j ; j
boardij;
sigil;
sigilX;
sigilO;
void play;
private:
char sigil;
int board;
void drawBoard;
bool isMoveLegalint row, int column;
int winner;
bool isGameOver;
;
void TicTacToe::drawBoard
cout endl;
forint i ; i ; i
cout i ;
forint j ; j ; j
cout sigilboardij;
cout endl;
bool TicTacToe::isMoveLegalint row, int column
return row && row && column && column && boardrowcolumn;
int TicTacToe::winner
check rows and columns
forint i ; i ; i
ifboardi boardi && boardi boardi && boardi
return boardi;
ifboardi boardi && boardi boardi && boardi
return boardi;
return ;
check diagonals
ifboard board && board board && board
return board;
ifboard board && board board && board
return board;
return ;
bool TicTacToe::isGameOver
ifwinner
return true;
forint i ; i ; i
forint j ; j ; j
ifboardij
return false;
return true;
void TicTacToe::play
int currentPlayer ;
whileisGameOver
drawBoard;
cout "player currentPlayer sigilcurrentPlayer enter your move row and column: ;
int row column ;
cin row column;
whileisMoveLegalrow column
cout "Invalid move. Try again: ;
cin row column;
boardrowcolumn currentPlayer;
currentPlayer
