Project 1

Code

        ///Name: Mark Katz
    ///Period: 6
    ///Program Name: Choose Your Own Adventure 2
    ///File Name: adventure2.java
    ///Date Finished: 10/15/15


import java.util.Scanner;
    
    public class adventure2
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            
            String r1, e1, f1, f2, f3, e3, e4, f4, e5="";
            
            System.out.println( "WELCOME TO THE LAST DAY OF YOUR LIFE! HAHAHAHA!" );
            System.out.println( "You are in a haunted house. There are many possabilities that will end your life, but only one that will allow you to escape." );
            System.out.println( "Choose wisely my good friend. " );
            System.out.println( "You are standing in the hallway of a huanted house. There are two doors. One leads upstairs, and one leads downstairs into the basement. You can also leave the house and go outside. What do you choose? (up, down, out)" );
            System.out.print( ">" );
            r1 = keyboard.next();
            System.out.println( "" );
            
            //upstairs
            
            if (r1.equals("up"))
            {
                System.out.println( "You open the door and you walk up the creaking, dark, and cold stairway. You start to hear a loud thumping noise." );
                System.out.println( "You make it up stairs and you are at a T hallways. To the left there is a child's bedroom door, creaked open with a light on. To the right there is a door with someone banging on it from the inside. Which way do you go? (left or right)" );
                System.out.print( ">" );
                e1 = keyboard.next();
               
                //left
                if (e1.equals("left"))
                {
                    System.out.println( "You walk down the hallway and see the door of a child's bedroom." );
                    System.out.println( "You creak the door open and you see a little toddler in his crib sleeping." );
                    System.out.println( "But he is holding something. Under further inspection, you see him holding a bloody knife, and under a crib is a dead body. The door slams shut behind ou and you can't get out that way." );
                    System.out.println( "You have two choices at this point." );
                    System.out.println( "Do you take the knife away from the baby, or do you jump out the window cause there's a murderous baby in a crib? (take or jump)" );
                    System.out.print( ">" );
                    f1 = keyboard.next();
                    System.out.println( "" );
                    
                    //take
                    if (f1.equals("take"))
                        {
                            System.out.println( "You walk towards the baby and try to take the knife away, but since its a murderous baby, he wakes up and stabs you 14 times in the chest and cuts your hands off and makes human hand soup with them. LOLOLOLOLOLOLOLOLOLOLOL YOU DEAD!!! TRY AGAIN!!!!!!!" );
                        }
                    else if (f1.equals("jump"))
                        {
                            System.out.println( "You realize that messing with a murderous baby is bad so you jump out the window to survive. Unlucky for you the house is on top of a cliff, and below the cliff is the city's sharp glass and huge boulder recycling plant, and so you fall and are cut up by the glass and hit a boulder and die. LOLOLOLOLOLOLOLOLOLOLOLOL YOU DEAD!!!!!! TRY AGAIN!!!!!!!" );
                        }
                }
        
                        
                //right
                else if (e1.equals("right"))
                {
                    System.out.println( "Idk why you picked to go to the banging door but ok. You walk over there as the banging gets louder. You open the door and there is a puppy that it making all the comotion. Youre confused how such a little thing makes such loud noises. Next to it you see a tranqualizer dart gun. You can either pick it up and play with it, or you can pick up the dart gun to stay safe. (dart or pick)" );
                    System.out.print( ">" );
                    f2 = keyboard.next();
                    System.out.println( "" );
                    
                    //dart
                        if (f2.equals("dart"))
                        {
                            System.out.println( "You pick up the dart gun, but accidently click on the trigger and shoot yourself in the hand. Also the dart didn't have sleepy stuff in it, it contained a lethal dose of cyanide. LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLO YOU DEAD!!!" );
                        }
                        else if (f2.equals("pick"))
                        {
                            System.out.println( "You pick up the puppy and there is tiny message on his collar. It says call this number so you do, and it turns out that dog was London Tipton's so she gets her helicopter to the house and flies you out to Boston and you get married. Happy ever after!!!!!!! You survived!!! How does that feel??? GOOD BYE!!!" );
                        }
                }
            }
                
                else if (r1.equals("down"))
                {
                    System.out.println( "You go downstairs into the basement. You look into the 'man cave' and see a drunk man passed out on the coach. You then look into a bedroom and see a giant machine, but you have no idea what it does. Do you wake up the drunk man, or do you look into the room. (wake or look)" );
                    System.out.print( ">" );
                    e3 = keyboard.next();
                    System.out.println( "" );
                    
                    //wake
                    if (e3.equals("wake"))
                    {
                        System.out.print( "You walk over to the drunk man try to wake him up but you can't. You turn him over and he coughs on you. Unlucky for you, that cough had the zombie virus in it and now you will infect the world. Congrats, you're patient zero of the human ending zombie apocalypse.LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOL YOU DEAD" );
                        System.out.print( "Luckily for you God gives you another chance. You can live or die, you choose. (live or die) ");
                        System.out.print( ">" );
                        f3 = keyboard.next();
                        
                        if (f3.equals("live"))
                        {
                            System.out.print( "LOLOLOLOL You think God would do that good one. You dead still> ");
                        }
                        else if (f3.equals("die"))
                        {
                            System.out.print( "Good choice. Youre still dead." );
                        }
                        
                        
                    }
                    //look
                    else if(e3.equals("look"))
                    {
                        System.out.println( "You walk over to the machine and there is a sign that says 'Time Machine'. You step into it and realize that you can stop WWII. You plug in September 1, 1939, the day the Nazis invaded Poland. You appear in Poland and a German Panzer tank runs you over and you die. LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOOLLLOOLOLLOLOLOLOLOL YOU DEAD!!!" );
                        System.out.println( "Luckily for you God gives you another chance. You can live or die, you choose. (live or die) ");
                        System.out.print( ">" );
                        f3 = keyboard.next();
                        
                        if (f3.equals("live"))
                        {
                            System.out.println( "LOLOLOLOL You think God would do that good one. You dead still> ");
                        }
                        else if (f3.equals("die"))
                        {
                            System.out.println( "Good choice. Youre still dead." );
                        }
                    }
                    
                }
            
            else if (r1.equals("out"))
            {
                System.out.println( "So idk why you would choose to go outside but you did. Ok. You walk outside and you don't look both ways and you almost get hit by a car. You see a spooky park. Do you go into it, or do you walk to the ice cream shop to your left?? (left or park" );
                System.out.print( ">" );
                e4 = keyboard.next();
                System.out.println( "" );
                
                if (e4.equals("left"))
                    {
                        System.out.println( "You chose to go to the ice cream parlor. What a yummy treat. There are a lot of flavors, but for the sake of the game, I will let you choose between two. Do you want vanilla or chocolate?" );
                        System.out.print( ">" );
                        f4 = keyboard.next();
                        System.out.println( "" );
                    
                    if(f4.equals("vanilla"))
                    {
                        System.out.println( "Sorry dude, but the reason your mom never let you eat ice cream is that you're deadly allergic. Youre dead now LOLOLOLOLOLOLOL" );
                    }
                    else if(f4.equals("chocolate"))
                    {
                        System.out.println( "Sorry dude, but the reason your mom never let you eat ice cream is that you're deadly allergic. Youre dead now LOLOLOLOLOLOLOL" );
                    }
                    
                else if (e4.equals("park"))
                {
                    System.out.println( "You walk towards the suppa creepy park. There is a man mudering a woman to your right, and another man murdering a woman to your left. Do you go to the left or right? (left or right)");
                    System.out.print( ">" );
                    e5 = keyboard.next();
                    System.out.println( "" );
                }
                    if (e5.equals("left"))
                    {
                        System.out.println( "You walk over to the man. Since he is murdering a woman, he turns around and murders you. LOLOLOLOLOL You're dead." );
                    }
                    else if (e5.equals("right"))
                    {
                        System.out.println( "You walk over to the man. Since he is murdering a woman, he turns around and murders you. LOLOLOLOLOL You're dead." );
                    }
                }
            }
        }
    }

    

Picture of the output

Project1