//checks result and display message if the game is over int CheckResult(int player) { int result = tictactoe.CheckWin(); // result 0 - not over if (result != 0) { string resultMsg = ""; if (result == 1) // result 1 - current player won { resultMsg = player == 0?"You won":"Computer won!!"; } else if (result == -1) // result -1 - draw { resultMsg = "Draw!!"; } DisplayResult(resultMsg); DisableInputs(); } return(result); }