Assignment 45

Code

  /// Name: Josh Bautista
  /// Period: 6
  /// Program Name: Adventure Time
  /// File Name: Adventure Time.java
  /// Date Finished: 12/10/2015
  
import java.util.Scanner;

public class AdventureTime
{
    public static void( String[] args )
    {
        Scanner keyboard = next Scanner(System.in);
        
        String path, leftRight, choice;
        
        System.out.print(" Welcome to the Haunted House of Scary! ");
        System.out.print("");
        System.out.print(" You walk up to a very scary looking house, the door is wide open and you hear screaming.");
        System.out.print(" What do you do? ");
        System.out.print(" 'Go inside' cautiously or 'look through the window'?");
        path = keyboard.next();
        if ( path.equals("Go inside "))
        {
            System.out.print( " You go inside cautiously, slowlly opening the doorway and walking inside into a hallway.");
            System.out.print( " The hallway is very long and dark, you keep walking until you reach the point where the hallway breaks to the left and the right");
            System.out.print(" What do you do?");
            System.out.print(" Go left or go right?");
            leftRight = keyboard.next();
            if ( leftRight.equals("Left"))
                {
                    System.out.print(" You walk down the right hallway, feeling the wall as you walk. Suddenly the floor gives way, you fall and lose conciousness. You wake up in a dark room groggy and tired, you seem to not be able to move.");
                    System.out.print("Suddenly the hairs on your neck stand up as you feel something crawling up your leg");
                    System.out.print(" What do you do?");
                    System.out.print(" Start shaking to get the thing off you or remain still ");
                    choice = keyboard.next();
                    if ( choice.equals("Start shaking to get the thing off you"))
                    {
                        System.out.print(" You start shaking to get the thing off you, but to no avail. You feel a prick on your leg and your whole body goes rigid. Your mouth is forced open as the insect goes in your mouth. You die of shock.");
                    }
                else if ( choice.equals(" Remain still "))
                {
                    System.out.print(" You remain still until the insect gets off your leg, suddenly the lights turn on to a room of spiders, bugs, and centipedes. You die of shock");
                }
            }
        }
    }
}
}

Picture of Output

Assignment 5