Assignemnt 77 and Adventure 2

Code

    /// Name: Xinting Chen
    /// Period: 7
    /// Program Name: Adventure 2
    /// File Name: Adventure2.java
    /// Date Finished: 2/2/2016
  
        import java.util.Scanner;
        public class Adventure2
        {
            public static void main( String[] args )
            {
                Scanner keyboard= new Scanner(System.in);
                int room = 1;
                String response = " ";
                
                while  (room!= 0)
                {
                    if (room == 1)
                    {
                        System.out.println(" You are in a scary house! Would you like to go upstairs or into the bathroom?");
                        System.out.print(">");
                        response = keyboard.next();
                        if (response.equals("upstairs"))
                            room = 2;
                        else if( response.equals("bathroom"))
                            room = 3;
                    }
                    if (room == 2)
                    {
                        System.out.println(" Upstairs you see a hallway. At the end of the hallway is the kitchen. There is also a bedroom off the hallway. Or, you can go back downstairs. Where wuld you like to go?");
                        System.out.print(">");
                        response = keyboard.next();
                        if (response.equals("kitchen"))
                            room = 4;
                        else if( response.equals("bedroom"))
                            room = 5;
                        else if( response.equals("downstairs"))
                            room = 1;
                    }
                    if (room == 3)
                    {
                        System.out.println(" What is in the bathroom? There is a tub of warm water. Would you like to take a bath, or go out of bathroom and go into the kitchen around the corner?");
                        System.out.print(">");
                        response = keyboard.next();
                        if (response.equals("bath"))
                            room = 6;
                        else if( response.equals("bedroom"))
                            room = 5;
                    }
                    if (room == 4)
                    {
                        System.out.println(" You go into the kitchen quietly. There is a refrigerator on your left. You may open the refrigerator or go back.");
                        System.out.print(">");
                        response = keyboard.next();
                        if (response.equals("refrigerator"))
                            room = 5;
                        else if( response.equals("back"))
                            room = 3;
                    }
                    if (room == 5)
                    {
                        System.out.println(" Now you're in the bathroom! The refrigerator also leads you to this room haha. Okay, in this room, you can decide to brush your teeth or wash your face. What would you like to do?");
                        System.out.print(">");
                        response = keyboard.next();
                        if (response.equals("brush"))
                            room = 6;
                        else if( response.equals("wash"))
                            room = 7;
                    }
                    if (room == 6)
                    {
                        System.out.println(" Brush your teeth? Are you kidding? You're dead." );
                        room = 0;
                    }
                    if (room == 7)
                    {
                        System.out.println("Wash your face! You survived! WOOHOOO When you open your eyes, you're back to your bedroom." );
                        room = 0;
                    }
                }
            }
        }

                
        


    

Picture of the output

Assignment 77