-
-
Save anonymous/ba652e6cd685f8131e66430a8bdc8ac7 to your computer and use it in GitHub Desktop.
my code for lecture 21 during challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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