-
-
Save codecademydev/54f7d375b337a358ec9c0d700f8005ba to your computer and use it in GitHub Desktop.
Codecademy export
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; | |
int main() { | |
int input = 0; | |
string playerName; | |
int proceed = 1; | |
cout << "Hello, new player. This is a text\n based adventure. Bet you haven't seen one of\n these in a while. Playing a game on the\n console of your computer? Strange indeed.\n\nHow about we begin by you telling me your name, eh?\n\n"; | |
cin >> playerName; | |
cout << "\n\n" << playerName << "! What a name. My name is Kai. I'll be your guide \nthroughout this adventure. It's worth \nnoting that from this point on, a new line \nof text (my voice) will only show (be spoken) when you enter the number 1 and then press enter on your \nkeyboard. But no rush! Press it whenever \nyou want. Afterall, you are welcome to play \nthis game however you want.\n\n"; | |
cin >> proceed; | |
cout << "\n\nSee how that works?\n\n"; | |
cout << "1) Yes.\n2) No.\n\n"; | |
cin >> input; | |
cout << "\n\n"; | |
if (input == 1) { | |
std::cout << "Excellent, " << playerName << ". Now let's continue on.\n\n"; | |
} | |
else if (input == 2) { | |
cout << "Honestly? I don't know why I bother.\n\n"; | |
return 0; | |
} | |
else { | |
cout << "That's not how you play the game. Restart program and try again."; | |
} | |
cout << "\n\n"; | |
cin >> proceed; | |
cout << "\n\n"; | |
cout << playerName << ", I'm pleased to see how quickly you catch on. The rest of this 'adventure' should be no problem for you.\n\n"; | |
cin >> proceed; | |
cout << "\n\nSpeaking of which, I guess you're probably wondering what kind of game we're about to play together, right?\n\n"; | |
cin >> proceed; | |
cout << "\n\nWell.. am I right?\n\n"; | |
cin >> proceed; | |
cout << "\n\n1) Come on, dude. Just tell me.\n2) I don't care anymore. Take me away from here now.\n\n"; | |
cin >> input; | |
if (input == 1) { | |
cout << "\n\nAlright. Just enter 1 into the console and press enter one more time and you'll get your answer.\n\n"; | |
} | |
else if (input == 2) { | |
cout << "\n\nWell.. nice knowing ya, I guess.\n\n"; | |
exit(1); | |
} | |
else { | |
cout << "\n\nPlease, you know how to play the game by this point. Restart and try again.\n\n"; | |
} | |
cin >> proceed; | |
cout << "\n\nListen, I get the feeling you're \ntired of entering 1 and pressing the enter\n button, right? My apologies. That's \njust how we play the game.\n\n"; | |
cin >> proceed; | |
cout << "\n\n" << playerName << ", I like you. If \nyou're with me this far in, you got some\n serious patients.\n\n"; | |
cin >> proceed; | |
cout << "\n\n1) Don't you mean 'patience'?\n2) Man, I am so done with you.\n\n"; | |
cin >> input; | |
if (input == 1) { | |
cout << "\n\nHuh, I think you're right.\n\n"; | |
} | |
else if (input == 2) { | |
cout << "\n\nAbout time.\n\n"; | |
return 0; | |
} | |
else { | |
cout << "\n\nSeriously, dude? Restart and try again."; | |
} | |
cin >> proceed; | |
cout << "\n\nAlright, guess the number between one and five and I'll tell you what we're really meant to do.\n\n"; | |
cin >> input; | |
int tries = 0; | |
while (input != 3 && tries < 100) { | |
cout << "\n\nWrong guess, try again!\n\n"; | |
cin >> input; | |
tries++; | |
} | |
if (input == 3) { | |
cout << "\n\nYou got it! Finally!\n\n"; | |
} | |
cin >> proceed; | |
cout << "\n\nAlright, alright. Get ready for \nthis, " << playerName << ". I don't think \nyou're gonna like what I have to say about \nthis game and how it's played.\n\n"; | |
cin >> proceed; | |
cout << "\n\nOne last time, are you ready for this?\n\n"; | |
cin >> proceed; | |
cout << "\n\n1) This better be worth it.\n2) Annnnd now I'm out of here.\n\n"; | |
cin >> input; | |
switch (input) { | |
case 1: | |
cout << "\n\nJust press 1 and enter one more time.\n\n"; | |
break; | |
case 2: | |
cout << "\n\nOh.. and you were so close to the end. Farewell.\n\n"; | |
break; | |
default: | |
cout << "\n\nRestart game, loser.\n\n"; | |
break; | |
} | |
cin >> proceed; | |
cout << "\n\nYou've been fantastic, " << playerName << ". Here is your reward:\n\n"; | |
cin >> proceed; | |
cout << " ░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄\n"; | |
cout << " ░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄\n"; | |
cout << " ░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█\n"; | |
cout << " ░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░█\n"; | |
cout << " ░▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░█\n"; | |
cout << " █▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒█\n"; | |
cout << " █▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█\n"; | |
cout << "░█▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█\n"; | |
cout << "░░█░░▀▄▀█▄▄░█▀▀▀▄▄▄▄▀▀█▀██░█\n"; | |
cout << "░░░█░░██░░▀█▄▄▄█▄▄█▄████░█\n"; | |
cout << "░░░░█░░░▀▀▄░█░░░█░███████░█\n"; | |
cout << "░░░░░▀▄░░░▀▀▄▄▄█▄█▄█▄█▄▀░░█\n"; | |
cout << "░░░░░░░▀▄▄░▒▒▒▒░░░░░░░░░░█\n"; | |
cout << "░░░░░░░░░░▀▀▄▄░▒▒▒▒▒▒▒▒▒▒░█\n"; | |
cout << "░░░░░░░░░░░░░░▀▄▄▄▄▄░░░░░█\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment