Code:
void guessinggame()
{
cout<<"\n\n--------------------------------------------------\n\n";
cout<<"GUESSING GAME\n\n";
cout<<"You will have 4 guess to guess a number between 0 and 30.\nGOOD LUCK!\n\n";
guessinggame();
}
//*****************************************
//* *
//* GUESSING GAME CONT *
//* *
//*****************************************
void guessinggamecont()
{
int input;
int choice;
for (int x=0; x<5; x++){
cout<<"Please enter your guess:";
cin>>input;
if (input == 17){
x=6;
cout<<"You are correct, thank you for playing the guesing game.\nYou will now be taken back to the Control Center.";
cin.get();
desktop;
}
else {
x++;
}
}
cout<<"Sorry, but you were unable to guess the secret number.\nWould you like to play again?";
cout<<"\n\n1.)Yes\n2.)No\n\nSelection:";
cin>>choice;
switch (choice){
case 1:
guessinggamecont();
break;
case 2:
desktop();
break;
default:
cout<<"INTERNAL ERROR [696E76616C696420656E74727900]";
cin.get();
cin.get();
return;
}
}
i found me error
Code:
void guessinggame()
{
cout<<"\n\n--------------------------------------------------\n\n";
cout<<"GUESSING GAME\n\n";
cout<<"You will have 4 guess to guess a number between 0 and 30.\nGOOD LUCK!\n\n";
guessinggame();
}
it kept calling upon it self, it should have been:
Code:
void guessinggame()
{
cout<<"\n\n--------------------------------------------------\n\n";
cout<<"GUESSING GAME\n\n";
cout<<"You will have 4 guess to guess a number between 0 and 30.\nGOOD LUCK!\n\n";
guessinggamecont();
}