Project 1 Choose Your Own Slightly Longer Adventure!

Code

   
    /// Name: Jake Johnson
    /// Period: 7
    /// Program Name: LongerAdventure
    /// File Name: LongerAdventure.java
    /// Date Finished: 12/1/2015
    
import java.util.Scanner;

public class LongerAdventure
{
    public static void main (String[] args)
    {
        String A1, A2, A3;
        
        Scanner keyboard = new Scanner(System.in);
        
        System.out.println("WELCOME TO JAKE'S LONGER ADVENTURE");
        
        System.out.println("You wake up in a creepy mansion! Would you like to go \"downstairs\" to the \"kitchen\" or \"upstaris\"?");
        A1 = keyboard.next();
        
        if (A1.equals("downstairs"))
        {
            System.out.println("In the basement you see a \"closet\" and a \"wardrobe\". which do you open?");
            A2 = keyboard.next();
            
            if (A2.equals("closet"))
            {
                System.out.println("In the closet you see a spooky ghost! would you like to \"fight\" the spooky ghost or \"run\" from the spooky ghost?");
                A3 = keyboard.next();
                
                if (A3.equals("fight"))
                {
                    System.out.println("you fight the spooky ghost and lose. You die.");
                }
                else if (A3.equals("run"))
                {
                    System.out.println("You try to run from the spooky ghost, but he catches you. You die.");
                }
            }
            else if (A2.equals("wardrobe"))
            {
                System.out.println("You open the wardrobe and a spooky ghost appears! THE GHOST DEMANDS YOU GIVE HIM YOUR SOUL? Do you give him your soul? (\"yes\" or \"no\"");
                A3 = keyboard.next();
                
                if (A3.equals("yes"))
                {
                    System.out.println("The ghost consumes your soul, you die.");
                }
                else if (A3.equals("no"))
                {
                    System.out.println("You refuse to give him your soul, and he eats you. You die.");
                }
            }
        }
        else if (A1.equals("kitchen"))
        {
            System.out.println("You go in the kitchen and you see a \"rerfrigerator\" and a \"cabinet\". Which do you open?");
            A2 = keyboard.next();
            
            if (A2.equals("refrigerator"))
            {
                System.out.println("You open the refrigerator, but there is a bunch of nasty food in it, do you eat the food? (\"yes\" or \"no\")");
                A3 = keyboard.next();
                
                if (A3.equals("yes"))
                {
                    System.out.println("you eat the food and die of food poisoning");
                }
                else if (A3.equals("no"))
                {
                    System.out.println("you refuse to eat the food and die of starvation");
                }
            }
            else if (A2.equals("cabinet"))
            {
                System.out.println("In the cabinate you find some expired corn flakes. Do you eat them? (\"yes\" or \"no\")");
                A3 = keyboard.next();
                
                 if (A3.equals("yes"))
                {
                    System.out.println("you eat the cornflakes and find maggots in it! You die of a heart attack.");
                }
                else if (A3.equals("no"))
                {
                    System.out.println("you refuse to eat the corn flakes and die of starvation");
                }
            }
        }
        else if (A1.equals("upstairs"))
        {
            System.out.println("You go upstairs and you see a \"bathroom\" and a \"bedroom\". Where do you go??");
            A2 = keyboard.next();
            
            if (A2.equals("bathroom"))
            {
                System.out.println("You enter the bathroom, it is empty, would you like to go back? (\"yes\" or \"no\")");
                A3 = keyboard.next();
                
                if (A3.equals("yes"))
                {
                    System.out.println("You turn around, but the door is closed, and locked, you never leave.");
                }
                else if (A3.equals("no"))
                {
                    System.out.println("You stay in the bathroom forever.");
                }
            }
            else if (A2.equals("bedroom"))
            {
                System.out.println("In the bedroom you see a bed, you are tired, do you go to sleep on the bed? (\"yes\" or \"no\")");
                A3 = keyboard.next();
                
                 if (A3.equals("yes"))
                {
                    System.out.println("You never wake up.");
                }
                else if (A3.equals("no"))
                {
                    System.out.println("You wake up and a spooky ghost has been waiting to devour you. You die.");
                }
            }
        }
    }
}
    

Picture of the output

This should work