Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void PrintIntro();
- string GetGuess();
- int main() {
- PrintIntro();
- string Guess = "";
- Guess = GetGuess();
- // repeat the guess back to them
- cout << "Users Guess: " << Guess << "\n";
- return 0;
- }
- void PrintIntro() {
- constexpr int WORD_LENGTH = 5;
- // introduce the game
- cout << "Welcome to bulls and Cows\n";
- cout << "Can you guess the " << WORD_LENGTH << " letter isogram I'm thinking of?\n";
- return;
- }
- string GetGuess() {
- // get a guess from the player
- string Guess = "";
- cout << "\nPlease Enter Guess: ";
- getline(cin, Guess);
- return Guess;
- }
Add Comment
Please, Sign In to add comment