void tictactoe( char game[][2] )
{
x = false;
move = 0;
int n = 49;
for( int r = 2; r >= 0; r-- )
{
for( int c = 0; c <= 2; c++ )
{
game[r][c] = n;
n++;
}
}
}
And
void drawInterface( char game[][2] )
{
cout << " --- --- --- " << endl
<< "| " << game[0][0] << " | " << game[0][1]
<< " | " << game[0][2] << " |" << endl;
cout << " --- --- --- " << endl
<< "| " << game[1][0] << " | " << game[1][1]
<< " | " << game[1][2] << " |" << endl;
cout << " --- --- --- " << endl
<< "| " << game[2][0] << " | " << game[2][1]
<< " | " << game[2][2] << " |" << endl
<< " --- --- --- " << endl;
}
Basically, the board SHOULD look like
--- --- --- | 7 | 8 | 9 | --- --- --- | 4 | 5 | 6 | --- --- --- | 1 | 2 | 3 | --- --- ---
But for some reason, the 1 is a 6, and the 4 is a 9. I can't figure out why this is happening.
It looks like the first column is replaced with the last column of the row before it.
Could anybody help me out as to why this is happening?

New Topic/Question
Reply



MultiQuote




|