My code so far

#include <iostream>
#include <string>

using namespace std;

//Function declarations:
void PrintIntro();
void PlayGame();
string GuessIsogram();

int main()
{
	PrintIntro();
	PlayGame();
	return 0;
}

void PrintIntro() //Introduce game to the player.
{
	constexpr int WORD_LENGTH = 5;
	cout << "Welcome to Bulls and Cows, a fun word game.\n";
	cout << "Can you guess the " << WORD_LENGTH << " letter isogram that I'm thinking of?\n";
	return;
}

void PlayGame() //Running the main game loop function.
{
	constexpr int TRIES = 5;
	for (int i = 1; i <= TRIES; i++) //Loop for the number of turns.
	{
		cout << "You guessed: " << GuessIsogram() << endl;
	}
	return;
}

string GuessIsogram() //Get a guess from the player.
{
	string Guess = "";
	cout << "\nTake a guess: ";
	getline(cin, Guess);
	return Guess;
}

Privacy & Terms