Advertisement
Guest User

Untitled

a guest
Aug 31st, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. package com.anderstolf.onlineex;
  2.  
  3. import java.io.Console;
  4.  
  5. /**
  6. *
  7. * @author Anders
  8. */
  9. public class youradventure {
  10. public static void main(String[] args ){
  11.  
  12. Console console = System.console();
  13.  
  14. String uporkit = console.readLine("\nYou are in a creepy house! "
  15. + "Would you like to go \"upstairs\" or into the \"kitchen\"?\n");
  16.  
  17. if (uporkit.equals("upstairs")){
  18. String bedorbath = console.readLine("\n You can go to \"bedroom\" or to \"bathroom\"\n");
  19.  
  20. if (bedorbath.equals("bedroom")){
  21. String sleepno = console.readLine("\n You see a bed. Do you take a nap? \"yes\" or \"no\"\n");
  22.  
  23. if (sleepno.equals("yes")){
  24. System.out.println("You never wake up again!");
  25. }
  26. if (sleepno.equals("no")){
  27. System.out.println("You die from fatigue");
  28. }
  29. }
  30. if (bedorbath.equals("bathroom")){
  31. String pillno = console.readLine("\n You see some pills. You eaty? \"yes\" or \"no\"\n");
  32. if (pillno.equals("yes")){
  33. System.out.println("You die from ODing ");
  34. }
  35. if (pillno.equals("no")){
  36. System.out.println("\n You die from not taking you meds");
  37. }
  38. }
  39. }
  40. if (uporkit.equals("kitchen")){
  41. String fricup = console.readLine("\n You can either go to \"fridge\" or to \"cupbord\"\n");
  42. if (fricup.equals("fridge")){
  43. String eatno = console.readLine("\n You see some rancid food. You eaty? \"yes\" or \"not\"\n");
  44. if (eatno.equals("yes")){
  45. System.out.println("You die from eating rancid food");
  46. }
  47. if (eatno.equals("no")){
  48. System.out.println("\n You die from starvation");
  49. }
  50. }
  51. if (fricup.equals("cupbord")){
  52. String cupcake = console.readLine("\n You see a delicious looking cupcake. You eaty? \"yes\" \"no\"\n");
  53. if (cupcake.equals("yes")){
  54. System.out.println("You die from overeating");
  55. }
  56. if (cupcake.equals("no")){
  57. System.out.println("You die from starvation");
  58. }
  59. }
  60. }
  61.  
  62. }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement