Got carried away and did this

 //the entry point for application
int main() {
    PrintIntro();
    string Guess = GetGuess();
    RepeatGuess(Guess);

     cout << endl;
     return 0;
}

 //introduce the game
void PrintIntro() {
    constexpr int WORD_LENGHT = 5;
    cout << "Welcome to the BullsAndCows Game!" << endl;
    cout << "Can you guess the " << WORD_LENGHT;
    cout << " letter isogram I'm thinking of?" << endl;
    cout << endl;
    return;
}

//get the gues from user
string GetGuess() {
    cout << "Please enter your guese here: ";
    string Guess = "";
    getline(cin, Guess);
    return Guess;
}

//repeats guess
void RepeatGuess(string Guess) {
     cout << Guess << endl;
}

Just seemed wrong to let the get guess function do something else then just getting the guess :smiley:

2 Likes

Privacy & Terms