Adventure2

Code

import java.util.Scanner;

public class Adventure2
{
	public static void main( String[] args )
	{
		Scanner keyboard = new Scanner(System.in);
		
		int num, num1, num2, num3, num4, num5, num6;
        
        System.out.println(" So your about to Die so think fast, garage(1) or living room(2) " );
        num = keyboard.nextInt();
        
        while ( num == 1 )
        {
            System.out.println(" You see your path, are you sure?  Yes(1) No (2)" );
            num1 = keyboard.nextInt();
            
            if ( num1 == 1 )
            {
                num = 11;
            }
            if ( num1 == 2 )
            {
                System.out.println( " Nooooooooo, ever heard the term don't look back especially in a dark room...  " );
            }
        }
        if ( num == 11 )
        {
            System.out.println( " You make your way into the garage, and you see a table with a gun " );
            System.out.println(" ...you feel somthing behind you, you turn around but it was dark to see what it was" );
            System.out.println( " It seems like its about to pounce what do you do, dodge(1) or gun(2) " );
            num2 = keyboard.nextInt();
            
            if ( num2 == 1 )
        {
            System.out.println( " you tripped and the thing killed you " );
        }
        else if ( num2 == 2 )
        {
            System.out.println( " you made it to the gun and shot the thing but it managed to cut you arm off causing you to die of blood loss..." );
        }
        }
        
        
        if ( num == 2 )
        {
            System.out.println( "You close the door behind but then you suddenly hear a knock, what do you do, hide(1) or go upstairs(2)" );
            num3 = keyboard.nextInt();
            
            if ( num3 == 1 )
            {
            System.out.println( " As you hide a strange figure walks into a room, follow(1) or run to exit(2) " );
            num4 = keyboard.nextInt();
                        while ( num4 == 1 )
        {
            System.out.println( " Keep following(1) or go back(2) " );
            num5 = keyboard.nextInt();
            
            if ( num5 == 1 )
            {
                System.out.println( " What happened? " );
                num4 = 13;
            }
            while ( num5 == 2 )
            {
                System.out.println( " follow(1) or run to exit(2) " );
                num4 = keyboard.nextInt();
                
                if ( num4 == 1 )
                {
                    num5 = 3;
                }
                else if ( num4 == 2 )
                {
                    num5 = 3;
                    num4 = 2;
                }
            }
        }
        if ( num4 == 2 )
        {
            System.out.println( " Wow good job, now LEAVE " );
        }
                
            }
            else if ( num3 == 2 )
            {
            System.out.println( "you make your way upstairs, you trip and fall to your death" );
            }
        }
        
        

            
        
    }
}

Adventure2

Assignment 77