I'm literally on my fourth or so day of trying to learn the C++ language. I tried to use aspects from the Calculator code on reconectwork's youtube Channel. From there a made my own code and came across a number of problems and most of them i could fix logically. Until i got bored and i just did what the debug said or implied. So can someone help me out?
Here's the code for my very short test adventure word, game, thing.
#include <iostream>
#include <cstdlib>
using namespace std;
int main(void)
{
system("TITLE Slaying the Troll");
system("COLOR 8");
char cChar;
char cChar2;
char cDoagain;
do
system("CLS");
while (cout); cout << "Welcome to slaying the troll. Press e to enter."
<< endl;
cin >> cChar;
switch (cChar)
case 'e':
cout << "You enter a dark room with a single light source. Do you grab it? (Y or N)"
<< endl;
cin >> cChar2;
switch (cChar2)
{
case 'n':
cout << "Game over" << endl;
break;
switch (cChar2)
{
case 'y':
cout << "Troll kills you! LOLOLOLOL!";
break;
default:
cout << "wrong button :O" << endl;
break;
}
cout << "would you like to play again?(y or n)" << endl;
cin >> cDoagain;
}while (cDoagain == 'y');
system ("PAUSE");
return 0;
}