Anytime the cin fails, nothing gets stored for the variable, so whatever value it held previously it still holds. You can fix this either with a fail flag, or initializing the variable prior to the loop. Either:
Code:
pointdraw = -1;
do
{
system("CLS");
cout<<"\n\n\t[[ Scissors, Paper, Stone 2002 ]] - [ Coded by mvb ]";
cout<<"\n\n\t[ N E W G A M E ]";
cout<<"\n\n\tPOINTS DETAILS:";
cout<<"\n\n\tPoints for a win [ between 1 and 100 ]...";
cout<<"\n\t\t>> "<<pointwin;
cout<<"\n\n\tPoints for a draw [ between 0 and 100 ]...";
cout<<"\n\n\t\t>> ";
cin>>pointdraw;
if (cin.fail())
{
cin.clear();
cin.ignore();
}
} while (pointdraw < 0 || pointdraw > 100 );
Or something like:
Code:
bool fail = false;
do
{
system("CLS");
cout<<"\n\n\t[[ Scissors, Paper, Stone 2002 ]] - [ Coded by mvb ]";
cout<<"\n\n\t[ N E W G A M E ]";
cout<<"\n\n\tPOINTS DETAILS:";
cout<<"\n\n\tPoints for a win [ between 1 and 100 ]...";
cout<<"\n\t\t>> "<<pointwin;
cout<<"\n\n\tPoints for a draw [ between 0 and 100 ]...";
cout<<"\n\n\t\t>> ";
cin>>pointdraw;
if (cin.fail())
{
cin.clear();
cin.ignore();
fail = true;
}
} while (fail == true || pointdraw < 0 || pointdraw > 100);