本文整理汇总了C++中TicTacToe::DetermineWinner方法的典型用法代码示例。如果您正苦于以下问题:C++ TicTacToe::DetermineWinner方法的具体用法?C++ TicTacToe::DetermineWinner怎么用?C++ TicTacToe::DetermineWinner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TicTacToe
的用法示例。
在下文中一共展示了TicTacToe::DetermineWinner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
int userSelectedNumber;
TicTacToe board = TicTacToe();
bool status = false;
while (!status)
{
cout << "Player1(o): Enter a number between 1 and 9." << endl;
cin >> userSelectedNumber;
board.GetMove(userSelectedNumber, 'o');
board.PrintBoard();
if (board.DetermineWinner('o'))
{
cout << "Player1(o) has won the game!!" << endl;
status = true;
continue;
}
cout << "Player2(x): Enter a number between 1 and 9." << endl;
cin >> userSelectedNumber;
board.GetMove(userSelectedNumber, 'x');
board.PrintBoard();
if (board.DetermineWinner('x'))
{
cout << "Player2(x) has won the game!!" << endl;
status = true;
continue;
}
}
system("pause");
return 0;
}