Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int x=0;
- main()
- {
- printf("Welcome to your adventure\n\nPress any key to begin!\n");
- getch();
- printf("\n\r");
- printf("1. start game\n");
- printf("2. Instructions\n");
- printf("3. Exit\n\n");
- printf("\r");
- scanf("%d",&x);
- while (x != 1 && x != 2 && x != 3)
- {
- printf("That is not a valid option! Please try again!\n\n");
- printf("1. start game\n");
- printf("2. Instructions\n");
- printf("3. Exit\n\n\r");
- scanf("%d",&x);
- }
- switch(x)
- {
- case 1: break;
- case 2: instructions();
- break;
- case 3: return 0;
- break;
- }
- printf("To go for a walk outside, press 1\n");
- printf("To stay inside, press 2\n\n");
- scanf("%d",&x);
- while (x != 1 && x != 2)
- {
- printf("INVALID ENTRY. Chose between 1 or 2\n");
- scanf("%d",&x);
- }
- switch (x)
- { case 1:
- printf("You chose to go for a walk, and end up getting hit by a car!\n\n");
- getch();
- function1(x);
- break;
- case 2:
- printf("You chose to stay inside, and you sit down and watch tv\n\n");
- getch();
- function2(x);
- break;
- }
- printf("GAME OVER\n\a\a\a");
- getch();
- return 0;
- } /********END OF MAIN FUNCTION*************/
- instructions()
- {
- printf("The object of the game is simple. Pick between options 1 and 2 \n"
- "and make it a whole day without dying!\n\n");
- printf("Press any key to begin your adventure!\n\n");
- getch();
- }
- function1(x) /*You chose to go for a walk, and get hit by a car! */
- {
- printf("What would you like to do now?\n\n");
- printf("1. You can go to the hospital \n");
- printf("2. You can go home\n");
- scanf("%d",&x);
- while (x != 1 && x != 2)
- {
- printf("INVALID ENTRY. Chose between 1 or 2.\n");
- scanf("%d",&x);
- }
- switch(x)
- {
- case 1: printf("You go to the hospital and get fixed up.\n\n");
- getch();
- break;
- case 2: printf("Ignoring your injuries, you go home and die from internal bleeding!\n\n");
- getch();
- break;
- }
- if (x ==1)
- {function3(x);
- }
- else {}
- } /****END OF FUNCTION 1*****/
- function2(x) /*You chose to stay inside and sit down and watch tv! */
- {
- printf("What would you like to do now?\n\n");
- printf("1. You can clean the house\n");
- printf("2. You can go out to the bar for a drink!\n");
- scanf("%d",&x);
- while (x != 1 && x != 2)
- {
- printf("INVALID ENTRY. Chose between 1 or 2.\n");
- scanf("%d",&x);
- }
- if (x==1)
- {printf("You clean your house and it is spic and span!\n\n");
- getch();
- function4(x);
- }
- else {
- printf("You go out to the bar and drink, and end up so drunk that you get\n"
- "barbarically ass raped by some guy and die from aids!\n\n");
- getch();
- }
- } /*****END OF FUNCTION 2******/
- function3(x) /***You go to the hospital and get fixed up.****/
- {
- printf("What would you like to do now?\n\n");
- printf("1.Go home and get some much needed rest\n");
- printf("2.Follow your initial plan of going back out\n");
- scanf("%d",&x);
- while (x != 1 && x != 2)
- {
- printf("INVALID ENTRY. Chose between 1 or 2.\n");
- scanf("%d",&x);
- }
- if (x==1)
- {
- printf("You go home and relax! AH, YOU FEEL BETTER NOW!\n\n");
- getch();
- function5(x);
- }
- else {
- printf("on your way out the door, an ambulance outside\nthe hospital speeds passed, hits you,"
- "and kills you on impact! OWNED\n");
- getch();
- }
- } /***END OF FUNCTION 3******/
- function4(x) /***You clean your house and it is spic and span!*****/
- {
- printf("What would you like to do now?\n\n");
- printf("1.Go on Facebook and play Farmville\n");
- printf("2.Invite some friends over for drinks!\n\n");
- scanf("%d",&x);
- while (x != 1 && x != 2)
- {printf("INVALID ENTRY! Enter an option between 1 or 2\n\n");
- scanf("%d",&x);
- }
- if (x==1)
- {printf("You have fun playing Farmville, and everyone is happy!\n\n");
- getch();
- printf("By this time, it is almost 7pm. Victory is almost yours!\n\n");
- getch();
- function6(x);
- }
- else{
- printf("You invite friends over for drinks, end up too drunk\n"
- "and slip and break your neck\n\n");
- getch();
- printf("later on in the hospital, you die from your atrocious injuries.\n OWNED"
- "\n\n");
- getch();
- }
- }
- function5(x) /****You go home and relax! AH, YOU FEEL BETTER NOW!*****/
- {}
- function6(x) /******You have fun playing Farmville, and everyone is happy!********/
- {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement