Skip to content

Instantly share code, notes, and snippets.

Created October 6, 2017 22:36
Show Gist options
  • Save anonymous/3737f853a18e0ae704e0704fe7f4ac43 to your computer and use it in GitHub Desktop.
Save anonymous/3737f853a18e0ae704e0704fe7f4ac43 to your computer and use it in GitHub Desktop.
void PlayGame()
{
//loop for COUNT_MAX number asking for guesses
constexpr int COUNT_MAX = 5;
for (int count = 1; count <= COUNT_MAX; count++) {
string GuessBack = GetGuess();
cout << "You typed: " << GuessBack << endl;
cout << endl;
}
}
// get a guess from the player
string GetGuess()
{
string Guess = "";
cout << "Please type your word:\n";
getline(cin, Guess);
return Guess;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment