Assignment #77 and Adventure 2

Code

    /// Name: Brendan Baird
    /// Period: 6
    /// Program Name: Adventure 2
    /// File Name: Adventure2.java
    /// Date Finished: 12/3/2015
    
    import java.util.Scanner;

public class Adventure2
{
	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 cave. There is a \"left\" path and a \"right\" path." );
				System.out.print( "> " );
				choice = keyboard.nextLine();
				if ( choice.equals("left") )
					nextroom = 2;
				else if ( choice.equals("right") )
					nextroom = 3;
				else
					System.out.println( choice + " wasn't one of the options. Try again." );
			}
			if ( nextroom == 2 )
			{
				System.out.println( "You reach a dead end. There's nothing to do here except 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. Try again." );
			}
			if ( nextroom == 3 )
			{
				System.out.println( "You find yourself in a large tomb. There is only a single \"door\" at the other end of the tomb. There are many cascets along the wall, and one in the center. There is a \"chest\" in the corner." );
				choice = keyboard.nextLine();
				System.out.print( "> " );
				if ( choice.equals("door") )
					nextroom = 1;
				else if ( choice.equals("chest") )
					nextroom = 4;
				else
					System.out.println( choice + " wasn't one of the options. Try again." );
			}
			if ( nextroom == 4 )
			{
				System.out.println( "The chest is unlocked, and upon oppening it you hear a loud thud. One of the caskets have opened! A large skeleton with a great axe approaches you. You can pull out your \"dagger\" or try \"pyromancy\"." );
				choice = keyboard.nextLine();
				System.out.print( "> " );
				if ( choice.equals("dagger") )
					nextroom = 5;
				else if ( choice.equals("pyromancy") )
					nextroom = 6;
				else
					System.out.println( choice + " wasn't one of the options. Try again." );
			}
            if ( nextroom == 5 )
			{
				System.out.println( "You unsheathe your dagger and charge the skeleton beast. He brings down his axe but you roll from his attack. With no time to lose, you slash the back of the monster; the battle is over. You return to the chest, and within is a note..." );
				nextroom = 0;
			}
            if ( nextroom == 6 )
			{
				System.out.println( "You recite the incantation and just before the skeleton attacks, you unleash the fires of hell upon it. The skeleton stops and begins to cry. He tells you his name his Skeletor and only meant to greet you. After apologizing, Skeletor gives you a quest to defeat someone called the Dragonborn, located in Skyri-" );
				nextroom = 0;
			}
				
		}

		System.out.println( "\nThe game is over. The next episode can be downloaded for only 800 Microsoft points!" );
	}
	
}
    

Picture of the output

Assignment 77