Assignemnt # and

Code

      ///Name: Dakota Donahue
      ///Period: 5
      ///Project Name:
      ///File Name:
      ///Date: 3/10/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 wake up laying in the sun on top of a green, grass-covered hill. You look down the hill and see a worn down manor. You walk toward the manor and come to its doorstep. It appears the entire lot is rotting, but you wish to investigate as no other structures are around. Do you enter \"kick\" down the worn out door or attemp to \"turn\" the knob and swing it open swing it open. " );
      				System.out.print( "> " );
      				choice = keyboard.nextLine();
      				if ( choice.equals( "kick" ) )
      					nextroom = 2;
      				else if ( choice.equals( "turn" ) )
      					nextroom = 3;
      				else
      					System.out.println( choice + " wasn't one of the options. Try again." );
      			}
                  else if ( nextroom == 2 )
      			{
      				System.out.println( " You kick down the door and it swings open, its joints holding sturdily. You probably could have just opened it with your hand. You look forward and see two hallways, one goes diagonally to your \"left\" and the other diagonally to your \"right\". Which hallway do you walk down " );
      				System.out.print( "> " );
      				choice = keyboard.nextLine();
      				if ( choice.equals( "left" ) )
      					nextroom = 3;
                      else if ( choice.equals( "right" ) )
      					nextroom = 4;
      				else
      					System.out.println( choice + " wasn't one of the options. Try again." );
      			}
                  else if ( nextroom == 3 )
      			{
      				System.out.println( " You walk down the left hall, and come to a dead end, do you turn \"back\"? " );
      				System.out.print( "> " );
      				choice = keyboard.nextLine();
      				if ( choice.equals("back") )
      					nextroom = 2;
      				else
      					System.out.println( choice + " wasn't one of the options. Try again." );
      			}
                  else if ( nextroom == 4 )
      			{
      				System.out.println( " You walk down the right hallway and come to a set of doors. The left door is slightly opened and covered in chipping yellow paint. The right door is oddly well preserved, with a sheen of maple still reflecting light off of its surface. Do you open the \"left\" door or the \"right\" door, or turn \"back\"? " );
      				System.out.print( "> " );
      				choice = keyboard.nextLine();
      				if ( choice.equals("left") )
      					nextroom = 5;
      				else if ( choice.equals( "right" ) )
      					nextroom = 6;
                      else if ( choice.equals( "back" ) )
      					nextroom = 3;
      				else
      					System.out.println( choice + " wasn't one of the options. Try again." );
      			}
                  else if ( nextroom == 5 )
      			{
      				System.out.println( " You walk through the left door and find a giant sentient pepperoni pizza devouring the half digested corpse of a large bird of prey, do you turn \"back\", or do you \"stare\" in amazement? " );
      				System.out.print( "> " );
      				choice = keyboard.nextLine();
      				if ( choice.equals("back") )
      					nextroom = 4;
                      else if ( choice.equals("stare") )
      					nextroom = 7;
      				else
      					System.out.println( choice + " wasn't one of the options. Try again." );
      			}
                  else if ( nextroom == 6 )
      			{
      				System.out.println( " You walk through the left door and find a giant sentient pepperoni pizza devouring the half digested corpse of a large bird of prey, do you turn \"back\", or do you \"stare\" in amazement? " );
      				System.out.print( "> " );
      				choice = keyboard.nextLine();
      				if ( choice.equals("back") )
      					nextroom = 4;
      				else if ( choice.equals("stare") )
      					nextroom = 7;
      				else
      					System.out.println( choice + " wasn't one of the options. Try again." );
                  }
                  else if ( nextroom == 7 )
      			{
      				System.out.println( " The pizza turns its attention to you and licks its lips hungrily. You understand that your fate is now inescapable " );
                      System.out.println( "RIP IN PEPPERONIS." );;
      				choice = keyboard.nextLine();
                  }
              }
              
              
      	}
      }

      
    
ALettertoYourself