#include
#include
using namespace std;
void PrintIntro();
void PlayGame();
string GetGuess();
string PrintGuess();
string Guess = “”;
int main()
{
PrintIntro();
PlayGame();
return 0;
}
void PrintIntro()
{
// introduce the game
constexpr int WORD_LENGTH = 4;
cout << "Welcome to Bulls and Cows, a fun word game." << endl;
cout << endl;
cout << "Can you guess the " << WORD_LENGTH << " letter isogram I am thinking of? " << endl;
cout << endl;
return;
}
void PlayGame()
{
constexpr int TRIES = 5;
for (int Count = 1; Count <= TRIES; Count++)
{
GetGuess();
PrintGuess();
}
return;
}
string GetGuess()
{
// get a guess from the player
cout << "Enter your guess here: ";
getline(cin, Guess);
cout << endl;
return Guess;
}
string PrintGuess()
{
// print guess to player
cout << "Your guess was: " << Guess << endl;
cout << endl;
return Guess;
}