Skip to content

Instantly share code, notes, and snippets.

/main.cpp Secret

Created August 23, 2017 05:39
Show Gist options
  • Save anonymous/ba652e6cd685f8131e66430a8bdc8ac7 to your computer and use it in GitHub Desktop.
Save anonymous/ba652e6cd685f8131e66430a8bdc8ac7 to your computer and use it in GitHub Desktop.
my code for lecture 21 during challenge
#include <iostream>
#include <string>
using namespace std;
void printIntro();
void userGuesses();
int main()
{
printIntro();
userGuesses();
return 0;
}
void printIntro()
{
constexpr int WORD_LENGTH = 5; //Introduces game to user
cout << "Welcome to Bulls and Cows. "
<< "A fun and challenging word game.\n"
<< "Guess the "
<< WORD_LENGTH
<< " letter isogram word." << endl;
return;
}
void userGuesses()
{
//Takes input from the user
string Guess = "";
cout << "What is your guess: ";
getline(cin, Guess);
//repeats the input to the user
cout << "Your guess is: "
<< Guess << endl;
//Takes input from the user
cout << "What is your guess: ";
getline(cin, Guess);
//repeats the input to the user
cout << "Your guess is: "
<< Guess << endl;
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment