Change your if-elseif-else branch to store counter the desired value. You are just storing the value and looping over that.
while (counter = 15)
cout << "You have 15 chances" << endl;
The above will result in infinite loop.
Change it like following. Do not loop right in the if-else branch. Just store the counter.
if (choice == EASY)
{
counter = 15;
cout << "You have 15 chances" << endl;
}
else if (choice == INTERMEDIATE)
{
counter = 10;
cout << "You have 10 chances" << endl;
}
else if (choice == HARD)
{
counter = 5;
cout << "You have 5 chances" << endl;
}
This will give the user infinite chances to play single game
while(true)
{
but the following will give counter number of chances for single game but infinite number of games to play.
while(true)
{
while (counter--)
{
if(correct)
break;
else if (lower)
cout << "lower";
else
cout << "Higher";
}
cout << "Do you want to play again? Y/N";
cin >> Choice;
if(Choice == 'N')
break;
}