我需要弄清楚如何验证 2 个条件。
- 检查之前的号码是否已播放。
- 检查数字是否在 1 到 9 之间。
无论哪种情况,它都应该循环回到开头。在第一种情况下,它不应该运行,直到用户输入一个尚未播放的数字。
do
{
cout << "Interesting move, What is your next choice?: ";
cin >> play;
Pused[1] = play;
if(play != Pused[0] && play != cantuse[0] && play != cantuse[1] )
{
switch(play)
{
default:
cout << "Your choice is incorrect\n\n";
break;
}
}
}while(play != 1 && play != 2 && play != 3 && play != 4
&& play != 5 && play != 6 && play != 7 && play != 8 && play != 9);
Dis_board(board);