My Solution to Clarity is worth fighting for challenge

I don’t know how kosher this is, but it works :slightly_smiling_face:

void PlayGame()
{
constexpr int NUMBER_OF_TURNS{ 5 };
for (int count{ 1 }; count <= NUMBER_OF_TURNS; count++)
{
cout << "You entered : " << GetGuess() << endl << endl;
}
}

string GetGuess()
{
cout << "Please enter your guess : ";
string Guess{ β€œβ€ };
getline(cin, Guess);
return Guess;
}

Privacy & Terms