i have two problems , first, its not putting X or O on the board.
second, notice when you play it. it takes 2 enter before the next player turn.
i mean , example
player 1's turn
input: 1
input: 2
player 2's turn
input: 3
input: 4
player 1's turn
and then again and again it should be
player 1's turn
input : 1
player 2's turn
input : 2
player 1's turn
input 3
and so on and so ford til one of them win
Line 89 / 99 should be inside brackets of the else block otherwise the cin on those lines will always run regardless if its player one or two's turn - that will correct your double entry issue.
I don't see any code which displays the contents of the board array, all you do is draw the grid so even if you update that board array you wouldn't know unless you debug stepped it.
There may be other issues but that's what stood out to me.
I don't see any code which displays the contents of the board array, all you do is draw the grid so even if you update that board array you wouldn't know unless you debug stepped it.
that was what i thinking... on the first before i modified it
that board is
1 2 3 4 5 6 7 8 9 10 11 12 13 14
void TicTacToe::gameBoard() {
cout << "*----*----*----*" << endl;
for ( int H = 0; H < 3; H++ ) // H means height
{
for ( int W = 0; W < 3; W++) // W means width
{
if ( board [ H ][ W ] == '1')
{
cout << "| ";
}
}
cout << "|\n*----*----*----*\n" ;
}
}