import java.util.Scanner; public class Adventure { public static void main( String[] args ) { Scanner one = new Scanner(System.in); System.out.println("Welcome to Sid's Tiny Adventure"); System.out.println("\nYou are in a creepy house! Would you like to go upstairs or into the kitchen?"); String location = one.next(); if (one.equals("kitchen")) { 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."); String object = one.next(); if(object.equals("refrigerator")) { 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)?"); String decision = one.next(); if(one.equals("yes")) { System.out.println("You die from food poisoning"); } else if(one.equals("no")) { System.out.println("You die from starvation"); } else { System.out.println("You dun goofed."); } } else if(object.equals("cabinet")) { 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)"); String decision2 = one.next(); if(decision2.equals("yes")) { System.out.println("You die from food poisoning"); String decision = one.next(); } else if(decision2.equals("no")) { System.out.println("You die from starvation"); } else { System.out.println("You dun goofed."); } } else { System.out.println("You dun goofed."); } } else if (one.equals("upstairs")) { 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?."); String location2 = one.next(); if(location2.equals("bedroom")) { 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)"); String decision3 = one.next(); if(one.equals("yes")) { System.out.println("You die from food poisoning"); } else if(one.equals("no")) { System.out.println("You die from starvation"); } else { System.out.println("You dun goofed."); } } else if(location2.equals("bathroom")) { 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)"); String decision4 = one.next(); if(one.equals("yes")) { System.out.println("You die from food poisoning"); } else if(one.equals("no")) { System.out.println("You die from starvation"); } else { System.out.println("You dun goofed."); } } } else { System.out.println("You dun goofed."); } } }