Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.anderstolf.onlineex;
- import java.io.Console;
- /**
- *
- * @author Anders
- */
- public class youradventure {
- public static void main(String[] args ){
- Console console = System.console();
- String uporkit = console.readLine("\nYou are in a creepy house! "
- + "Would you like to go \"upstairs\" or into the \"kitchen\"?\n");
- if (uporkit.equals("upstairs")){
- String bedorbath = console.readLine("\n You can go to \"bedroom\" or to \"bathroom\"\n");
- if (bedorbath.equals("bedroom")){
- String sleepno = console.readLine("\n You see a bed. Do you take a nap? \"yes\" or \"no\"\n");
- if (sleepno.equals("yes")){
- System.out.println("You never wake up again!");
- }
- if (sleepno.equals("no")){
- System.out.println("You die from fatigue");
- }
- }
- if (bedorbath.equals("bathroom")){
- String pillno = console.readLine("\n You see some pills. You eaty? \"yes\" or \"no\"\n");
- if (pillno.equals("yes")){
- System.out.println("You die from ODing ");
- }
- if (pillno.equals("no")){
- System.out.println("\n You die from not taking you meds");
- }
- }
- }
- if (uporkit.equals("kitchen")){
- String fricup = console.readLine("\n You can either go to \"fridge\" or to \"cupbord\"\n");
- if (fricup.equals("fridge")){
- String eatno = console.readLine("\n You see some rancid food. You eaty? \"yes\" or \"not\"\n");
- if (eatno.equals("yes")){
- System.out.println("You die from eating rancid food");
- }
- if (eatno.equals("no")){
- System.out.println("\n You die from starvation");
- }
- }
- if (fricup.equals("cupbord")){
- String cupcake = console.readLine("\n You see a delicious looking cupcake. You eaty? \"yes\" \"no\"\n");
- if (cupcake.equals("yes")){
- System.out.println("You die from overeating");
- }
- if (cupcake.equals("no")){
- System.out.println("You die from starvation");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement