A few lines of the TicTacToe game:

cout << "Invalid move ";
player--;
cin.ignore();
cin.get();
}
i = checkwin();
player++;
} while (i == -1);
board();
if (i == 1)
cout << "==>\aPlayer " << --player << " win ";
else
cout << "==>\aGame draw";
cin.ignore();
cin.get();
return 0;
}
//------------------------------------------------------------------------
This is a few lines of the TicTacToe game - Can anyone explain how the below line works?
i = checkwin();
//------------------------------------------------------------------------
Hello samtheman,

Based on what you have "i" is being set to the return value of the function call "checkwin".

With out seeing the function "checkwin" my guess would be that "-1" means there is no win and "1" means a win.

Hope that helps,

Andy
Topic archived. No new replies allowed.