[ create a new paste ] login | about

Link: http://codepad.org/1eUjSi5z    [ raw code | output | fork ]

C++, pasted on Jun 4:
#include <iostream>
#include <time.h>
#include <string.h>
using namespace std;
int main()

{
char name [50];
char gender [50];
char heshe[5];
char heshecaps;
bool loop;
loop = 1;
bool loop2;
loop2 = 0;
bool loop3;
loop3 = 1;

double box;
box = 0;
double boxa;
boxa = 0;
double boxb;
boxb = 0;

bool poop;
poop = 0;

char action[15];


bool stickspear;
stickspear = 0;
int stick;
stick = 0;
bool stickcheck;
stickcheck = 0;
bool sticktorch;
sticktorch = 0;
bool lighton;
lighton = 0;


	
cout << "\n What... is your name?\n";
cin.getline(name, 49);
cout << "\n Are you a man... or a woman?\n";
cin.getline(gender, 49);
if (gender == "man" || "boy")
{heshe[0] = 'h';
heshe[1] = 'e';
 heshecaps[0] = 'H';
 heshecaps[1] = 'e';}
if (gender == "woman" || "girl")
{heshe = "she";
heshecaps = "She";}
cout << string( 100, '\n' );
	cout << "\n "<< name <<" awakes in a dark cave. All "<< heshe << " can see is a small fire in the distance.\n";
do{
	cout << "\n *What would you like to do?* \n"; 
	cout << "\n[A] Walk to the fire.\n";
	cout << "\n[B] Run to the fire.\n"; 
	cout << "\n[C] Stay where you are. You are comfy, after all.\n";

	if (poop == 0)
	{cout << "\n[D] POOP YOURSELF. WHAT IS GOING ON?\n";}
	cout << "\n\n\n (Tip) for any choice, press 'o' to start from scratch!\n";
	cin >> action[0];

switch (action[0])
{


	case 'a':
		loop = 0;

cout << string( 100, '\n' );
		cout << "\n " << name << " carefully approaches the fire. His vision remains dark and dull, but not for long. Slowly, "<<heshe<<" can see more clearly. By the fire "<<heshe<<" notices that there is a\n small box.\n";
do{		

		cout << "\n\n *What would you like to do?*\n";
		
		if (boxa != 1)

		{cout << "\n[A] Examine the box.\n";}

		if (boxb != 1)

		{cout << "\n[B] Put the box in the fire.\n";}

		cout << "\n[C] ROLL IN THE FIRE. IT LOOKS WARM.\n";
		cin >> action[1];
		
		switch (action[1])
		{	


			case 'a':
			{
cout << string( 100, '\n' );
			cout << "\n Picking up the box, " << name << " notices that it is extremely light, "
			"despite it's metal casing. There are the words 'BAD I-' written on it, and a "
			"blood stain covering the rest. You also notice a padlock blocking the opening "
			"mechanism.\n";
			boxa ++;

			continue;
			}




			
			case 'b':
			{
cout << string( 100, '\n' );
			cout << "\n "<<heshecaps<<" picks up the box, and hefts it into the flame. It sits there, not moving. \n Then, it melts, and in it " << name << " finds some sort of machine. \n\n *What would you like to do?*\n";
			boxb ++;
		
			cout << "\n[A] Risk snuffing out your only light source for the machine.\n";
			cout << "\n[B] Leave the machine to melt. It's not important.\n";
			cout << "\n[C] See if you can grab it quickly from the fire.\n";
			
			if (stickspear == true)
			{cout << "\n[D] Use your stick to push it out of the fire.\n";}

			cin >> action[2];



			switch (action[2])


			{
				case 'a':
cout << string( 100, '\n' );
				cout << " " << name << " snuffs out the fire with his leg. Everything goes black, except for the"
				" marigold embers of the fire. "<<heshecaps<<" feels for the machine and picks it up. It turns out"
				" that the machine was a flashlight!\n\n Happily surprised, "<<heshe<<"...\n\n";
			do
			{
				if (lighton == 1)
				{"\n\n *What would you like to do?*\n\n";}
				
				if (lighton == 0)
				{cout << "\n[A] Turn on the flashlight.\n";}
				if (lighton == 1)
				{cout << "\n[A] Turn off the flashlight.\n";}
				
				cout << "\n[B] Take the batteries out of the flashlight.\n";
				cout << "\n[C] EAT THE YUMMY FLASHLIGHT.\n";
				if (lighton == 1)
				{cout << "\n[D] Look around with the flashlight.\n";}
				cin >> action[3];
				
			switch (action[3])
			{
			case 'a':
			{
			if (lighton == 1)
			{
			cout << string( 100, '\n' );
			cout << "\n " << name << " clicks off the flashlight.\n";
			}
			if (lighton == 0)
			{
			cout << string( 100, '\n' );
			cout << "\n " << name << " clicks on the flashlight.\n";
			}
			}
			}
			} while (loop3 == 1);

			break;
			}



}
	
			case 'c':
			{
cout << string( 100, '\n' );
			cout << "\n\n\n\n\n As your body chars in the flames, you find yourself drooling. The flames\n"
			 " evaporate your spittle, and soon your skin melts.\n";
			cout << "\n Press [ENTER] to close the program...\n";
			loop2 = 1;
			cin.ignore();
	 		cin.get();
			return 0;
			break;
			}	
}



} while (loop2 != 1);



		case 'c':
		{
		loop = 0;

cout << string( 100, '\n' );
		 cout << "\n You decide to stay put. Besides, who knows might be waiting for you at the \n fire? You decide to explore your surroundings, relying mostly on touch, as all  you can see is the glowing embers in the distance. Using it as an anchor point, you feel around. You feel a hairy mass, a metallic stick, and a soft box shape.\n\n *What would you like to do?*\n";
	
		cout << "\n[A] Grab hairy mass and walk to fire.\n";
		cout << "\n[B] Grab stick and walk to fire.\n";
		cout << "\n[C] Grab box shape and walk to fire. \n";
		cin >> action[4];
			
		switch (action[4])
		{
			case 'a':
			{
cout << string( 100, '\n' );
			cout << "\n You grab the hairy mass by a lock of its fur and slowly walk towards the fire\n As the light grows, you find out to your horror that it was in fact a human \n head! \n\n Caught mid-scream, you...\n";
			cout << "\n[A] Throw it away!\n";
			cout << "\n[B] Try to identify the head. You might know him...\n";
			cout << "\n[C] BURNITBURNITBURNITBURNIT!\n";	
			cin >> action[5];

			switch (action[5])
			{
			case 'a':
cout << string( 100, '\n' );
			cout << " You toss the hideous head away. The poor soul's head tumbles off into the darkness,\n and suddenly it gets snatched up by some creature! It slowly creeps up \n towards you, piercing green eyes locked on to you."
			"\n\n Carefully, you...\n\n";
			cout << "[A] Slowly, slowly, back away.\n";
			cout << "[B] Run away!\n";
			cout << "[C] HUG HIM!\n";
			
			if (stickspear == 1)
			{cout << "[D] Use your spear to attack the creature.\n";}
			cin >> action[6];

			switch (action[6])
			{
			case 'a':
			{cout << string( 100, '\n' );
			cout << "\n Backing away carefully, you step over a twig. The cracking noise makes the creature pounce out towards you!\n\n Running for your dear life, you...\n";
			}

			case 'b':
			{cout << string(100, '\n');
			cout << "\n "<<name<<" gives up all common sense and high-tails it back to where "<<heshe<<" woke up. "<<heshecaps<<" seems to have tripped over some sort of twig, and the creature pounces."
			"It starts by eating "<<name<<"'s intestines, then moves up to the head."
			
			"\n\n\n Press [ENTER] to close the program...";
			cin.ignore();
			cin.get();
			}
			}
			}
			break;
			}



	
			case 'b':
			{
cout << string( 100, '\n' );
			cout << "\n You snatch up the stick and take it to the fire. In the increasing light you \n notice that there is asolutely nothing spectial about it at all. \n\n You decide to...\n";
			if (stickcheck == false)
			{cout << "\n[A] Further examine the stick.\n";}
			cout << "\n[B] Rip some of your shirt off and make the stick into a makeshift torch.\n";
			cout << "\n[C] Break the stick at the tip to make a spear.\n";
			cin >> action[7];
			}	
			switch (action[7])
			{	
				case 'a':
				{cout << string( 100, '\n' );
					cout << "\n Rolling the stick around in your hand, you notice a small tag on it. It reads 'GAS POWERED STICK! NOW 20% MORE GAS PER STICK!'\n";
					stickcheck = 1;		

					continue;
				}

				case 'b':
				{cout << string( 100, '\n' );
				cout << "\n You rip some of your shirt off at the hem, and tie it around the tip of the stick. You hold the end product over the flames, and it bursts into flame. Suprisingly, It doesn't burn you alive. Your makeshift torch does not seem to go out, and you decide to take it with you.\n";
				sticktorch = 1;
				continue;}
				
				case 'c':
				{cout << string( 100, '\n' );
				cout << "\n You snap off the stick with your foot. With a satisfying 'crunch', you manage to turn the ordinary stick into a killing weapon.\n";
				stickspear = 1;
				continue;}
				}



case 'c':
				{
cout << string( 100, '\n' );
					cout << "\n You take the box shape with you and continue towards the fire. the box turns \n out to be a pouch of some sort, held together with velcro. \n\n You choose to...\n";
					break;
				}
			}
			break;
		}
	

case 'b':
{
loop = 0;

cout << string( 100, '\n' ); 
		 cout << "\n In his mad dash to the small glimpse of safety, " << name << " ironically trips over some\n sort of twig. "<<heshecaps<<" falls over some kind of bridge, invisible in\n the low light. The fall didn't kill him.\n\n\n\n\n But the lions did.\n";
		 cout << "\n Press [ENTER] to close the program...\n";
		 cin.ignore();
		 cin.get();
		 break;	
		}




case 'd':
{
cout << string( 100, '\n' );
	cout << "\n\n "<<heshecaps<<" accomplishes absolutely nothing. Try again.\n";
	poop = 1;
	continue;


}	
case 'o':
{
cout << string( 100, '\n' );
	cout  << "\n\n Starting over...\n ...\n ... \n done!\n\n";
	poop = 0;
	continue;
}


	default:
{
cout << string( 100, '\n' );	
		cout << "\n Nice try, Sherlock Holmes!\n";
		continue;
}	

}


} while (loop == 1); 
} 


Output:
1
2
3
In function 'int main()':
Line 52: error: invalid types 'char[int]' for array subscript
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: