Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created December 17, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/e1a5138c3174ddf2131ba894113abad6 to your computer and use it in GitHub Desktop.
Save codecademydev/e1a5138c3174ddf2131ba894113abad6 to your computer and use it in GitHub Desktop.
Codecademy export
#include <iostream>
int main(){
char InputAB ='M', InputCD = 'M', InputGH ='M', InputIJ = 'M',InputEF = 'M', InputKL = 'M', InputMN = 'M';
int validate = 0;
std::cout << "\n\n"
"--------TEXT ADVENTURE--------\n\n\n\n";
while (validate != 3) {
std::cout << "You're shipwrecked on a desert island, you have decided to set up a base camp but where?\n\n"
" Make your choice\n"
"A) On the beach\n"
"or\n"
"B) In the Trees\n";
std::cin >> InputAB;
if (InputAB == 'A') {
std::cout << "You decided to set your camp on the beach, now you need to find some fresh water. Where are you going to search?\n\n"
"Make your choice\n"
"C) Search along the coastline\n"
"or\n"
"D) Enter the jungle\n";
std::cin >> InputCD;
if (InputCD == 'C'){
std::cout << "On the coast line you find another survivor, what are you going to do?\n\n"
"G) Wave to the survivor, and call him over\n"
"or\n"
"H) Run towards the survivor\n";
std::cin >> InputGH;
if (InputGH == 'G'){
std::cout << "The survivor has a gun and starts shooting in your direction, your hit. YOU DIE.\n";
return 0;
}
else if (InputGH == 'H'){
std::cout << "The survivor draws a knife and stabs you in the heart. YOU DIE.\n";
return 0;
}
else{
std::cout << "That was not one of the options\n"
"\n\n\n\n"
"______________________________________\n";
}
}
else if (InputCD == 'D'){
std::cout << "You find a river full water looks clean, and there are fish swiming. Feeling hungry you decide to do some spot of fishing.\n\n"
"I) Make your self a wooden spear, and start spear fishing on the bank.\n"
"or\n"
"J) Go back to the beach see if you can find a net to catch the fish.\n\n";
std::cin >> InputIJ;
if (InputIJ == 'I'){
std::cout << "You slip on the river bank and implae yourself on the spike. YOU DIE.\n";
return 0;
}
else if (InputIJ == 'J'){
std::cout << "While serching for the net you see a ship, you light a fire to send a signal. They see you, your rescued.\n";
return 0;
}
else{
std::cout << "That was not one of the options\n"
"\n\n\n\n"
"______________________________________\n";
}
}
else{
std::cout << "That was not one of the options\n"
"\n\n\n\n"
"______________________________________\n";
}
}
else if (InputAB == 'B'){
std::cout << "The jungle is dence, you make your way to a clearing where you stbumble upon a hut. The hut is coverd in vines, no one has used the place for a while. You explore the local area.\n\n"
"E) You decide to enter the hut.\n"
" or\n"
"F) Next to the hut you find a kayak.\n\n";
std::cin >> InputEF;
if (InputEF == 'E'){
std::cout << "Inside the hut you find a two way radio, however the isn't working. On the wall of the hut you see a map of the island, you can see there is another hut marked on the map.\n"
"K) Try and fix the radio.\n"
"or\n"
"L) Set out in search of the second hut.\n";
std::cin >> InputKL;
if (InputKL == 'K'){
std::cout << "Opening the radio a snake jumps out and bites you. This is the most venomus snake in the world. YOU DIE\n";
return 0;
}
else if (InputKL == 'L'){
std::cout << "At last you find the second hut. This one is in a much better condition. You are greeted by two locals who are living on the island. They have a satllite phone, so you can call your family to let them know your safe and be rescued.\n";
return 0;
}
else{
std::cout << "That was not one of the options\n"
"\n\n\n\n"
"______________________________________\n";
}
}
else if (InputEF == 'F'){
std::cout << "The kayak is in a good condition, and is seaworthy. You need supplies \n\n"
"M) You see a coconut tree, collect as many as you can for your journey home.\n"
"or\n"
"N) Fill a bottle you find with fresh water from a river, and go for it.\n";
std::cin >> InputMN;
if (InputMN == 'M'){
std::cout << "A coconut falls on your head, when you wake up your in your bedroom. It was all a dream.\n";
return 0;
}
else if (InputMN == 'N'){
std::cout << "Your gamble pays off, after 2 days at sea you are seen by a passing ship. You are saved.\n";
return 0;
}
else{
std::cout << "That was not one of the options\n"
"\n\n\n\n"
"______________________________________\n";
}
}
else{
std::cout << "That was not one of the options\n"
"\n\n\n\n"
"______________________________________\n";
}
}
else {
std::cout << "\n"
"You chose badly.\n"
"That is not a option.\n"
"\n RESTART\n"
"______________________\n";
validate++;
}
}
std::cout <<"\n"
" \n"
" .(@@@@@&&&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& &&&&&&&@,,,,*(&&,,,,/&#&####%%%##&( \n"
" *% .#. //,,,,&&&&&&&#%&&&&&@#(/,,*@@,*%,,*&##%###%/(&#@. \n"
" .@. /*,,,,*&&&&&&&&&(*/#&@@,,/@&&#/,,*&###&#%#%###&@. \n"
" .#&&(*#*,,,,,,,/&##&&&&&&&&&&#,,,&&&&@&####&#%***%#&&# \n"
" &&@(,,#*,,#&&&@&&%%%#(%&&&@*,&&&&@%&(*#&&#&((%#&&# \n"
" .@&&&,,(&&@%%#%, (*&&&@@&&&&.&%#*%/(&&&%//@, \n"
" .@&&@@&&&&&*,,,(* .%(&&&&&&& *&%@&%@%%%%&(@/%/ \n"
" ,@&&&&&&&&&,*/((((((###(*. %%&&&&&@ %%%%%%%%%%%&%%%%/ \n"
" ,@&&&&&&&&&&&&&&&&&#*,,,,,*%&&&&&&% .&%%%%%%%%%%%%%%%/ \n"
" .@&&&@&&&&&&&&&&&&&&&&&&&&&&&&&&&&/ #%%%%%%%%%%%%%%%%/ \n"
" @&&&@&&&&&&&&&&&&&&&&&&&&&&&&&&&@%%&%*&%%%%%%%%%%%%%%%%/ \n"
" /%. @&&&&&&&&&&&&&&&&&&&&&&&&&&&%%%%%&@&&%%%%%%@,,/%@@&/ \n"
" /@&&&&&&&&&&&&&&&&&&&@&&&&@%%%%%%%%%%%%%%%%%%@/ \n"
" #&&&&&&&@&&&&&&&&&&&@@&&@%%%%%%%%%%%%%%%%%%%%%@* \n"
" &&&&@@* @&&&&&&&&@@%%@@%%%%%%%%%%%%%%%%%%%%%%%%@. \n"
" *@&@* @&&&&&&@/*&%%(&%%%%%%%%%%%%%%%%%%%%%%%%&# \n"
" ./ &&&&@# .@%%&(&%%%%%%%%%%%%%%%%%%%%%%%%%& \n"
" %@#\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment