Advertisement
stanziak

Untitled

Apr 14th, 2016
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Adventure
  3. {
  4. public static void main( String[] args )
  5. {
  6. Scanner one = new Scanner(System.in);
  7. System.out.println("Welcome to Sid's Tiny Adventure");
  8. System.out.println("\nYou are in a creepy house! Would you like to go upstairs or into the kitchen?");
  9. String location = one.next();
  10.  
  11. if (one.equals("kitchen"))
  12. {
  13. System.out.println("There is a long countertop with dirty dishes everywhere. Off to one side there is, as you'd expect, a refrigerator. You may open the refrigerator or look in a cabinet.");
  14. String object = one.next();
  15. if(object.equals("refrigerator"))
  16. {
  17. System.out.println("Inside the refrigerator you see food and stuff. It looks pretty nasty. Would you like to eat some of the food (yes or no)?");
  18. String decision = one.next();
  19. if(one.equals("yes"))
  20. {
  21. System.out.println("You die from food poisoning");
  22. }
  23. else if(one.equals("no"))
  24. {
  25. System.out.println("You die from starvation");
  26. }
  27. else
  28. {
  29. System.out.println("You dun goofed.");
  30. }
  31. }
  32. else if(object.equals("cabinet"))
  33. {
  34. System.out.println("Inside the cabinet you see food and stuff. It looks pretty nasty. Would you like to eat some of the food? (yes or no)");
  35. String decision2 = one.next();
  36. if(decision2.equals("yes"))
  37. {
  38. System.out.println("You die from food poisoning");
  39. String decision = one.next();
  40. }
  41. else if(decision2.equals("no"))
  42. {
  43. System.out.println("You die from starvation");
  44. }
  45. else
  46. {
  47. System.out.println("You dun goofed.");
  48. }
  49. }
  50. else
  51. {
  52. System.out.println("You dun goofed.");
  53. }
  54. }
  55. else if (one.equals("upstairs"))
  56. {
  57. System.out.println("Upstairs you see a hallway. At the end of the hallway is the master bedroom. There is also a bathroom off the hallway. Where would you like to go?.");
  58. String location2 = one.next();
  59. if(location2.equals("bedroom"))
  60. {
  61. System.out.println("You are in a plush bedroom, with expensive-looking hardwood furniture. The bed is unmade. In the back of the room, the closet door is ajar. Would you like to open the door? (yes or no)");
  62. String decision3 = one.next();
  63. if(one.equals("yes"))
  64. {
  65. System.out.println("You die from food poisoning");
  66. }
  67. else if(one.equals("no"))
  68. {
  69. System.out.println("You die from starvation");
  70. }
  71. else
  72. {
  73. System.out.println("You dun goofed.");
  74. }
  75. }
  76. else if(location2.equals("bathroom"))
  77. {
  78. System.out.println("You are in a plush bedroom, with expensive-looking hardwood furniture. The bed is unmade. In the back of the room, the closet door is ajar. Would you like to open the door? (yes or no)");
  79. String decision4 = one.next();
  80. if(one.equals("yes"))
  81. {
  82. System.out.println("You die from food poisoning");
  83. }
  84. else if(one.equals("no"))
  85. {
  86. System.out.println("You die from starvation");
  87. }
  88. else
  89. {
  90. System.out.println("You dun goofed.");
  91. }
  92. }
  93. }
  94. else
  95. {
  96. System.out.println("You dun goofed.");
  97. }
  98. }
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement