Assignment #77 and Short Adventure 2

Code

    /// Name: Tim Chuang
/// Period: 7
/// Program Name: Short Adventure 2
/// File Name: ShortAdventure2.java
/// Date Finished: 3/3/2016

 import java.util.Scanner;

public class ShortAdventure2
{
	public static void main( String[] args )
	{
		Scanner keyboard = new Scanner(System.in);
		
		int nextroom = 1;
		String choice = "";

		while ( nextroom != 0 )
		{
			if ( nextroom == 1 )
			{
				System.out.println( "You are in a crimson room. You get the feeling that you have been here before, but can't remember when. There is a \"basement\" and a doorway to the \"hall\"." );
				System.out.print( "> " );
				choice = keyboard.nextLine();
				if ( choice.equals("basement") )
					nextroom = 2;
				else if ( choice.equals("hall") )
					nextroom = 3;
				else
					System.out.println( choice + " wasn't one of the options." );
			}
			if ( nextroom == 2 )
			{
				System.out.println( "You're in a dark basement. Its too spooky. Plus, you hear spooky noises so you go \"back\"." );
				System.out.print( "> " );
				choice = keyboard.nextLine();
				if ( choice.equals("back") )
					nextroom = 1;
				else
					System.out.println( choice + " wasn't one of the options." );
			}
			if ( nextroom == 3 )
			{
				System.out.println( "Stepping past the door, you enter the hall. A splashing sound echoes as you take a step, and you look down, realizing you have stepped in a pool of blood. Alarmed, you run off into the darkness. Before long, you realize you are completely immersed in darkness, and grasp around. You finally find a \"door handle\". At the same time, you can hear an engine starting up in the distance. Do you go for the \" door handle\" or the \"noise\"?" );
				choice = keyboard.nextLine();
				System.out.print( "> " );
				if ( choice.equals("door handle") )
					nextroom = 5;
				else if ( choice.equals("noise") )
					nextroom = 4;
				else
					System.out.println( choice + " wasn't one of the options." );
			}
			if ( nextroom == 4 )
			{
				System.out.println( " You start towards the car engine-like noise. Whoever was responsible for that noise might be able to help. As you approach, the noise gets louder, until it is almost deafening. All of a sudden, you see sparks flashing from the ground, and see the blurred outline of a person. And then you realize, the sound was never a car engine. Another flash, and you see the shadow's crazed eyes. You start running, but before you get far, you see the chainsaw out of the corner of your eye. The next second, you are starting at your own decapitated body. She lifts you up and whispers into your ear 'Lets restart the game, Yuuki.' The words ring in your head, until you fade into black. ");
				nextroom = 0;
                
			}
			if ( nextroom == 5 )
            {
                System.out.println( " The door makes a huge groaning noise as you attempt to open it, but you get the door open. There is another \"door\" near the wall. Do you open it?" );
                choice = keyboard.nextLine();
                System.out.print( "> " );
                if ( choice.equals("door") )
                    nextroom = 6;
                else
                    System.out.println( choice + " wasn't one of the options." );
		}

		if ( nextroom == 6)
        {
            System.out.println( "You open it. You feel a cold gust from below, and witness a 40 foot drop onto jagged rocks covered in numerous corpses. A hand pulls you back, and you turn around to thank them, but a cold shiver settles in, and you discover a knife sunk hilt deep into your stomach. Unable to speak, you stumble backwards and fall out of the door onto the rocks. The last thing you see is the girl's maniacal smile." );
        }
	}
	
}
}

    

Picture of the output

Assignment 77