if(tries >= 20) {
std::cout << "You ran out of tries!\n\n";
} else {
std::cout<<"Congratulations!! " << std::endl;
std::cout<<"You got the right number in " << tries << " tries!\n";
}
while(true) {
std::cout << "Would you like to play again (Y/N)? ";
std::cin >> answer;
std::cin.ignore();
Now, I want to do two things:
1. I want to change the number of tries from 20 to infinity
2. I want to give the user an option to exit the game by inputting -1.
How can I do this? Thanks a million!