Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. int x=0;
  5.  
  6. main()
  7. {
  8.  
  9. printf("Welcome to your adventure\n\nPress any key to begin!\n");
  10. getch();
  11. printf("\n\r");
  12. printf("1. start game\n");
  13. printf("2. Instructions\n");
  14. printf("3. Exit\n\n");
  15. printf("\r");
  16. scanf("%d",&x);
  17.  
  18.  
  19.  
  20. while (x != 1 && x != 2 && x != 3)
  21. {
  22. printf("That is not a valid option! Please try again!\n\n");
  23. printf("1. start game\n");
  24. printf("2. Instructions\n");
  25. printf("3. Exit\n\n\r");
  26. scanf("%d",&x);
  27.  
  28. }
  29.  
  30. switch(x)
  31. {
  32. case 1: break;
  33.  
  34. case 2: instructions();
  35. break;
  36. case 3: return 0;
  37. break;
  38.  
  39. }
  40. printf("To go for a walk outside, press 1\n");
  41. printf("To stay inside, press 2\n\n");
  42. scanf("%d",&x);
  43.  
  44. while (x != 1 && x != 2)
  45. {
  46. printf("INVALID ENTRY. Chose between 1 or 2\n");
  47. scanf("%d",&x);
  48. }
  49.  
  50. switch (x)
  51. { case 1:
  52. printf("You chose to go for a walk, and end up getting hit by a car!\n\n");
  53. getch();
  54. function1(x);
  55. break;
  56. case 2:
  57. printf("You chose to stay inside, and you sit down and watch tv\n\n");
  58. getch();
  59. function2(x);
  60. break;
  61.  
  62.  
  63. }
  64.  
  65.  
  66.  
  67. printf("GAME OVER\n\a\a\a");
  68.  
  69.  
  70. getch();
  71. return 0;
  72.  
  73.  
  74. } /********END OF MAIN FUNCTION*************/
  75.  
  76.  
  77. instructions()
  78. {
  79. printf("The object of the game is simple. Pick between options 1 and 2 \n"
  80. "and make it a whole day without dying!\n\n");
  81. printf("Press any key to begin your adventure!\n\n");
  82. getch();
  83.  
  84. }
  85.  
  86. function1(x) /*You chose to go for a walk, and get hit by a car! */
  87.  
  88. {
  89. printf("What would you like to do now?\n\n");
  90. printf("1. You can go to the hospital \n");
  91. printf("2. You can go home\n");
  92. scanf("%d",&x);
  93.  
  94. while (x != 1 && x != 2)
  95. {
  96. printf("INVALID ENTRY. Chose between 1 or 2.\n");
  97. scanf("%d",&x);
  98. }
  99.  
  100. switch(x)
  101. {
  102. case 1: printf("You go to the hospital and get fixed up.\n\n");
  103. getch();
  104. break;
  105. case 2: printf("Ignoring your injuries, you go home and die from internal bleeding!\n\n");
  106. getch();
  107. break;
  108. }
  109.  
  110. if (x ==1)
  111. {function3(x);
  112. }
  113. else {}
  114.  
  115.  
  116. } /****END OF FUNCTION 1*****/
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123. function2(x) /*You chose to stay inside and sit down and watch tv! */
  124.  
  125. {
  126. printf("What would you like to do now?\n\n");
  127. printf("1. You can clean the house\n");
  128. printf("2. You can go out to the bar for a drink!\n");
  129. scanf("%d",&x);
  130. while (x != 1 && x != 2)
  131. {
  132. printf("INVALID ENTRY. Chose between 1 or 2.\n");
  133. scanf("%d",&x);
  134. }
  135.  
  136. if (x==1)
  137. {printf("You clean your house and it is spic and span!\n\n");
  138. getch();
  139. function4(x);
  140. }
  141.  
  142. else {
  143. printf("You go out to the bar and drink, and end up so drunk that you get\n"
  144. "barbarically ass raped by some guy and die from aids!\n\n");
  145. getch();
  146. }
  147.  
  148.  
  149. } /*****END OF FUNCTION 2******/
  150.  
  151.  
  152. function3(x) /***You go to the hospital and get fixed up.****/
  153. {
  154. printf("What would you like to do now?\n\n");
  155. printf("1.Go home and get some much needed rest\n");
  156. printf("2.Follow your initial plan of going back out\n");
  157. scanf("%d",&x);
  158.  
  159. while (x != 1 && x != 2)
  160. {
  161. printf("INVALID ENTRY. Chose between 1 or 2.\n");
  162. scanf("%d",&x);
  163. }
  164.  
  165. if (x==1)
  166. {
  167. printf("You go home and relax! AH, YOU FEEL BETTER NOW!\n\n");
  168. getch();
  169. function5(x);
  170. }
  171. else {
  172. printf("on your way out the door, an ambulance outside\nthe hospital speeds passed, hits you,"
  173. "and kills you on impact! OWNED\n");
  174. getch();
  175. }
  176.  
  177.  
  178. } /***END OF FUNCTION 3******/
  179.  
  180.  
  181. function4(x) /***You clean your house and it is spic and span!*****/
  182. {
  183. printf("What would you like to do now?\n\n");
  184. printf("1.Go on Facebook and play Farmville\n");
  185. printf("2.Invite some friends over for drinks!\n\n");
  186. scanf("%d",&x);
  187.  
  188. while (x != 1 && x != 2)
  189. {printf("INVALID ENTRY! Enter an option between 1 or 2\n\n");
  190. scanf("%d",&x);
  191. }
  192.  
  193. if (x==1)
  194. {printf("You have fun playing Farmville, and everyone is happy!\n\n");
  195. getch();
  196. printf("By this time, it is almost 7pm. Victory is almost yours!\n\n");
  197. getch();
  198. function6(x);
  199. }
  200. else{
  201. printf("You invite friends over for drinks, end up too drunk\n"
  202. "and slip and break your neck\n\n");
  203. getch();
  204. printf("later on in the hospital, you die from your atrocious injuries.\n OWNED"
  205. "\n\n");
  206. getch();
  207. }
  208. }
  209.  
  210.  
  211. function5(x) /****You go home and relax! AH, YOU FEEL BETTER NOW!*****/
  212. {}
  213.  
  214.  
  215. function6(x) /******You have fun playing Farmville, and everyone is happy!********/
  216. {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement