The following code contains a logical error every time i run it and enter 1 or 0 the code in the while loop is still executed. can someone tell me why?
bool getmove()
{
bool move;
cout << "Would you like to make the first move?(1 for yes 0 for no)\n";
cin >> move;
while(move != 1 || move != 0 || !cin.good())
{
if(!cin.good())
{
cout << "ERROR please try again\n";
cin.clear();
cin.ignore(80,'\n');
cin >> move;
}
else
{
cout << "Invalid input please try again\n";
cin >> move;
}
}
return move;
}