Advertisement
Guest User

GetGuess

a guest
Oct 19th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. void PrintIntro();
  6. string GetGuess();
  7.  
  8. int main() {
  9.     PrintIntro();
  10.     string Guess = "";
  11.     GetGuess();
  12.  
  13.     //repeat guess back to player
  14.     cout << endl;
  15.     cout << "Your guess was: " << Guess << endl;
  16.  
  17.     return 0;
  18. }
  19.  
  20. void PrintIntro() {
  21.     //intruduce the player to the game
  22.     constexpr int WORD_LENGHT = 5;
  23.     cout << "Welcome to Bulls and Cows,a fun word game \n";
  24.     cout << "Can you guess the " << WORD_LENGHT << " letter isogram?\n";
  25.     cout << endl;
  26.     cout << "Input your guess: ";
  27.     return;
  28. }
  29.  
  30. string GetGuess() {
  31.     //get guess from player
  32.     string Guess = "";
  33.     getline(cin, Guess);
  34.     return Guess;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement