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);