Hello.
creating a simple menu so the player can insert what difficulty he would like to play at.
Code:
int main()
{
char choice = 'y';
do
{
enum difficulty{Easy = 1, Medium, Hard};
cout << "\t\tWelcome to my Menu.\n\n";
cout << "1 - Easy\n";
cout << "2 - Normal\n";
cout << "3 - Hard\n\n";
int choose;
cout << "Choice: ";
cin >> choose;
switch(choose)
{
case 1:
cout << "You picked the difficulty: Easy";
break;
case 2:
cout << "You picked the difficulty: Normal";
break;
case 3:
cout << "You picked the difficulty: Hard";
break;
default:
cout << " You can only choose from 1-3, try again? (Y/N)\n: ";
cin >> choice;
system("cls");
}
}
while(choice == 'y');
cout << "Okey then, bye.";
getch();
return 0;
}
How come the program reloops the program in an instant after I have picked 1-3?
works like it should do when I pick 4.