Assignment #77 and Seventy-Fourth Program

Code

        /// Name: Georgi Atanasov
        /// Period: 5
        /// Program Name: Adventure 2
        /// File Name: Adventure2.java
        /// Date Finished: 3/1/2016
    
    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 room. 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 cavern. There is only a single \"door\" at the other end of the cavern. There are many dead people 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 opening it you hear the voice of the Lord and Savior Morgan Freeman. One of the caskets have opened! A large skeleton with a rather big axe approaches you. You can pull out your \"woodpecker\" or try \"roasting\"." );
				choice = keyboard.nextLine();
				System.out.print( "> " );
				if ( choice.equals("woodpecker") )
					nextroom = 5;
				else if ( choice.equals("roasting") )
					nextroom = 6;
				else
					System.out.println( choice + " wasn't one of the options. Try again." );
			}
            if ( nextroom == 5 )
			{
				System.out.println( "You unsheathe your woodpecker 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 with your peck; the battle is over. You return to the chest, and in it is a note..." );
				nextroom = 0;
			}
            if ( nextroom == 6 )
			{
				System.out.println( "You eat a grape cuz why not... I mean you just ended a freakin skeleton. Congrats dude you deserve a grape amirite? Anyways now you are feeling pretty pumped and you end up outside, ready to go home when suddenly the ground opens up and yo-" );
				nextroom = 0;
			}
				
		}

		System.out.println( "\nThe game is over. The next chapter can be unlocked for 679 tokens!" );
	}
	
}
    

Picture of the output

Assignment 77