1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
#include <iostream>
#include <iomanip>
#include <string>
#include <Windows.h>
#include <sstream>
using namespace std;
int main()
{
int day (1), red, blue, white, green, yellow;
stringstream day1choices;
HANDLE hConsole;
hConsole = GetStdHandle (STD_OUTPUT_HANDLE);
//series 1
char tree, tool, material, house, monster_scenario;
string result;
int treeop, toolop, materialop, houseop, monster_scenarioop;
//series 2
char activity;
cout << "Can you survive in Minecraft? \n";
system ("pause");
//day 1
while (day = 1){
day1:
for(green = 2; green < 3; green++)
SetConsoleTextAttribute(hConsole,green);
cout << "Day " << day << "\n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
cout << "You wake up and find a tree. What do you do? \n Chop <c> or Leave <l>? \n";
cin >> tree;
if (tree == 'c'){
cout << "You obtain some wood and create wooden planks. \n What tool do you want to make? \n Pickaxe <p> or Sword <s>? \n";
cin >> tool;
if (tool == 'p'){
cout << "You make a pickaxe and head off to the nearby mountain. \n What material do you collect? \n Dirt <d> or Cobblestone <c>? \n";
cin >> material;
if (material == 'c'){
cout << "You gather some cobble and notice the sun is starting to set. \n Do you make a house? \n Yes <y> or No <n>? \n";
cin >> house;
if (house == 'y'){
cout << "You make a house and are starting to feel sleepy. \n Where do you lay down at? \n Downstairs <d> or Upstairs <u>? \n";
cin >> monster_scenario;
//pickaxe, cobblestone, house
if (monster_scenario == 'd'){
for(blue = 1; blue < 2; blue++)
SetConsoleTextAttribute(hConsole,blue);
cout << "You survived the first night! \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
day = 2;
day1choices << tree << tool << material << house << monster_scenario << "\n";
string day1code (day1choices.str());
cout << "Your day code is " << day1code;
system ("pause");
goto day2;}
else if (monster_scenario == 'u'){
for(blue = 1; blue < 2; blue++)
SetConsoleTextAttribute(hConsole,blue);
cout << "You survived your first night! \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
day = 2;
day1choices << tree << tool << material << house << monster_scenario << "\n";
string day1code (day1choices.str());
cout << "Your day code is " << day1code;
system ("pause");
goto day2;}
}
else if (house == 'n'){
cout << "You walk through the night, looking for more supplies. \n A skeleton appears and starts to fire at you \n How do you respond? \n Run away <r> or Fight Back <f>? \n";
cin >> monster_scenario;
//pickaxe, cobblestone, no house
if (monster_scenario == 'f'){
for(red = 4; red < 5; red++)
SetConsoleTextAttribute(hConsole,red);
cout << "You try to fight, but unfortunately the skeleton is able to block your pickaxe and \n finish you off with a blow to the chest. \n You have died. \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
system ("pause");
goto day1;}
else if (monster_scenario == 'r'){
for(red = 4; red < 5; red++)
SetConsoleTextAttribute(hConsole,red);
cout << "You try to run, but unfortunately the skeleton gets \n a headshot on you with one finishing blow. \n You have died. \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
system ("pause");
goto day1;}
}
}
else if (material == 'd');{
cout << "You gather some dirt and notice the sun is starting to set. \n Do you make a house? \n Yes <y> or No <n>? \n";
cin >> house;
if (house == 'y'){
cout << "You make a house and are starting to feel sleepy. \n Where do you lay down at? \n Downstairs <d> or Upstairs <u>? \n";
cin >> monster_scenario;
//pickaxe, dirt, house
if (monster_scenario == 'd'){
for(red = 4; red < 5; red++)
SetConsoleTextAttribute(hConsole,red);
cout << "A zombie awakens you in your sleep. \n You grab your pickaxe and try to kill it \n but unfortunately the zombie doesn't die and starts to munch on your limbs. \n You have died.";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
system ("pause");
goto day1;}
else if (monster_scenario == 'u'){
for(blue = 1; blue < 2; blue++)
SetConsoleTextAttribute(hConsole,blue);
cout << "You survived your first night! \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
day = 2;
day1choices << tree << tool << material << house << monster_scenario << "\n";
string day1code (day1choices.str());
cout << "Your day code is " << day1code;
system ("pause");
goto day2;}
}
else if (house == 'n'){
cout << "You walk through the night, looking for more supplies. \n A creeper appears and quickly moves towards you. How do you respond? \n Run away <r> or Fight Back <f>? \n";
cin >> monster_scenario;
//pickaxe, dirt, no house
if (monster_scenario == 'f'){
for(red = 4; red < 5; red++)
SetConsoleTextAttribute(hConsole,red);
cout << "The creeper gets close enough to you to hit but this triggers its explosive reaction. You have died. \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
system ("pause");
goto day1;}
else if (monster_scenario == 'r'){
for(blue = 1; blue < 2; blue++)
SetConsoleTextAttribute(hConsole,blue);
cout << "You manage to get away from the creeper safely. \n, You barely surivived the night. \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
day1choices << tree << tool << material << house << monster_scenario << "\n";
string day1code (day1choices.str());
cout << "Your day code is " << day1code;
day = 2;
system ("pause");
goto day2;}
}
}
}
else if (tool == 's');{
cout << "You make a sword and head off to the nearby forest. \n What material do you collect? \n Dirt <d> or Wood <w>? \n";
cin >> material;
if (material == 'w'){
cout << "You gather some wood and notice the sun is starting to set. \n Do you make a house? \n Yes <y> or No <n>? \n";
cin >> house;
if (house == 'y'){
cout << "You make a house and are starting to feel sleepy. \n Where do you lay down at? \n Downstairs <d> or Upstairs <u>? \n";
cin >> monster_scenario;
//sword, wood, house
if (monster_scenario == 'd'){
for(blue = 1; blue < 2; blue++)
SetConsoleTextAttribute(hConsole,blue);
cout << "You survived the first night! \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
day = 2;
day1choices << tree << tool << material << house << monster_scenario << "\n";
string day1code (day1choices.str());
cout << "Your day code is " << day1code;
system ("pause");
goto day2;}
else if (monster_scenario == 'u'){
for(blue = 1; blue < 2; blue++)
SetConsoleTextAttribute(hConsole,blue);
cout << "You survived your first night! \n";
for(white = 7; white < 8; white++)
SetConsoleTextAttribute(hConsole,white);
day = 2;
day1choices << tree << tool << material << house << monster_scenario << "\n";
string day1code (day1choices.str());
cout << "Your day code is " << day1code;
system ("pause");
goto day2;}
}
|