#include
#include
using namespace std;
//prototyping
void PrintIntro();
void PlayGame();
string Guess;
string GetGuess();
string PrintBack();
//Game Starts
int main()
{
PrintIntro();
PlayGame();
return 0; //exit
}
//Actual Game
void PlayGame()
{
//looping the number of attempts
constexpr int Number_Of_Tries = 10;
for (int attempts = 1; attempts <= Number_Of_Tries; attempts++)
{
cout << "Guess number: " << attempts << endl;
GetGuess();
PrintBack();
}
}
//implementation of the function
void PrintIntro()
{
// Introduce the game
constexpr int WORD_LENGTH = 5;
cout << “Welcome to Bulls and Cows, a fun word game.\n”;
cout << “Can you guess the " << WORD_LENGTH;
cout << " letter isogram I am thinking of?\n”;
cout << endl;
return;
}
//Get a guess from the player
string GetGuess()
{
cout << "Your guess is: ";
getline(cin, Guess);
cout << endl;
return Guess;
}
string PrintBack()
{
//display guess
cout << "Your guess was: " << Guess << endl;
cout << endl;
return Guess;
}