Choose Your Own Adventure

Code

    /// Name: Rachel Smith
    /// Period: 5
    /// Program Name: Choose Your Own Adventure
    /// File Name: ChooseYourOwnAdventure.java
    /// Date Finished: 11/2/2015
    
    import java.util.Scanner;
    
    public class ChooseYourOwnAdventure {
        
        public static void main( String[] args ) {
            
            Scanner keyboard = new Scanner(System.in);
            
            String q1, q2, q22, q3, q33, q333, q3333, name, name2;
            
            System.out.println( "WELCOME TO RACHEL'S TINY ADVENTURE!" );
            System.out.println();
            
            System.out.println( "You wake up with a headache and in total darkness. You are tied to vacuum cleaner inside of a cramped closet. Although your eyes are blindfolded you can hear some muted conversation outside the closet. It seems to be far away but you can't tell.");
            System.out.println( "Do you \"a\" use your feet to open the door or \"b\" wait and listen to the conversation?");
            q1 = keyboard.next();
            System.out.println();
            
            if ( q1.equals("a") ) {
                System.out.println( "Although you cannot see anything, you feel a sudden cold rush of air and the sound of uneven steps coming towards you. The approaching creature's breathing is ragged and inhuman sounding. Suddenly you hear a loud gunshot and the sound of a man shouting. You're saved! You quickly work to remove the blindfold by rubbing it against your knee. The room appears to be a walk-in freezer. As you look up you see two men with greasy black hair, suits, and sunglasses approaching the body of a humainoid creature laying on the floor, oozing dark blood. They haven't noticed you yet." );
                System.out.println( "Do you \"a\" call out to the men for help or \"b\" hide in the closet and listen to what they are doing?" );
                q2 = keyboard.next();
                System.out.println();
                
                if ( q2.equals("a") ) {
                    System.out.println( "The men turn towards you, surprised. They look at eachother and exchange a knowing glance. One continues to watch the creature as it writhes on the floor. The other rasies his pistol and begins to advance toward you slowly. \" Jean Balfour, vous etes arretez pour les crimes de guerre. Levez-vous les mains, maintenant.\" You may not understand the man, but you can tell that this situation will not go well for you." );
                    System.out.println( "Do you \"a\" speak to the man in english and try to convince him that you are innocent or \"b\" run from the man with the gun?" );
                    q3 = keyboard.next();
                    System.out.println();
                    
                    if ( q3.equals("a") ) {
                        System.out.println( "To your extreme relief the man quickly switches to english but still seems suspicious. By now the monster has stopped writhing an both men are looking at you. The second one asks, \"You are Jean Balfour, aren't you..? Wait, what is your name? Can you tell me?\" " );
                        System.out.println( "Enter your name:" );
                        name = keyboard.next();
                        System.out.println( "The man is surprised. He whispers to his comrade, \"Hold on, wasn't " + name + " one of the original victims from the first attacks 5 years ago?\" The other man frowns, \"But how could he still be alive? He does look like the man in the photo... except unshaven. But Balfour would know his name, and he could grow a beard!\" He raises his gun again but sighs. \"Ah well I guess we'll have to take him in for a questioning and testing. Okay, " + name + ", if that's your real name. Let's go.\" " );
                        System.out.println( "CONGRATULATIONS " + name + "! YOU MADE IT OUT ALIVE!" );
                    
                    }
                    
                    else if ( q3.equals("b") ) {
                        System.out.println( "The man shoots you." );
                        System.out.println( "YOU DIED. LAME." );
                    }
                    
                    else {
                        System.out.println( "You screwed up." );
                    }
                }
                
                else if ( q2.equals("b") ) {
                    System.out.println( "The men begin to congratulate eachother. \"All right! That was the last of the mutant creatures. This thing is so gross!\" The other man laughs, \"Tell me about it! At least now the brass will be happy with me and maybe I'll get a promotion! Then I don't have to work with you anymore!\" The other man scoffs, and silence follows. The sound of shuffling and dragging follows, and you are about to exit the closet when one says something: \"Don't you ever feel bad covering up these crazy things from the public? I mean maybe they have a right to know how their dollars are being spent.\" The other man falters but replies jocularly: \"Don't start growing a concious on me here Buck!\" They both laugh and silence follows." );
                    System.out.println( "You have just learned some very interesting information" );
                    System.out.println( "You spend about fifteen minutes getting yourself free of your bonds. You walk out into the room, which turns out to be a walk-in freezer. As you walk into the main part part of the building you hear police sirens approaching." );
                    System.out.println( "Do you \"a\" run out the back door or \"b\" do the legal thing and give a statement to the police?" );
                    q33 = keyboard.next();
                    System.out.println();
                    
                    if ( q33.equals("a") ) {
                        System.out.println( "As you run out the back door you come upon a stable (this is a legit mansion you're in). You jump onto a golden stallion and ride bareback into the sunset. Having lost faith in your government, you move to Canada and become a buffalo farmer." );
                        System.out.println( "CONGRATULATIONS! YOU MADE IT OUT ALIVE!" );
                    
                    }
                    
                    else if ( q33.equals("b") ) {
                        System.out.println( "The police shoot you on sight." );
                        System.out.println( "YOU DIED. LAME." );
                    }
                    
                    else {
                        System.out.println( "You screwed up." );
                    }
            
                }
            }
            
            else if ( q1.equals("b") ) {
                System.out.println( "There are two voices. One seems to be an elderly British man and the other is a young woman. At first their conversation seems genial, if strained. The man says, \"Your mother and I think it would be best for you to go away to school for a little while. White Chapel has proven a far too dangerous town for a naive girl like you.\" In a voice that sounds familiar, the other replies, \"It's not your choice who I love. I won't go to boarding school; White Chapel is already prison enough. Besides, you're not even my real father. If mother agrees with you, then let me hear it from her mouth.\" A chair slides out in a loud screech and the girl's voice can be heard: \"Wait-- stop! What are you doing!?\" A the same time the man is yelling over her: \"How dare you disrespect me! This is my roof you live under and my food you eat!\" The girl begins to cry out." );
                System.out.println( "Do you \"a\" free yourself of the vacuum and charge out of the closet blind to the rescue of the girl or \"b\" take the time to unbind your hands, remove your blindfold, and find a weapon?" );
                q22 = keyboard.next();
                System.out.println();
                
                if ( q22.equals("a") ) {
                    System.out.println( " The old man starts when he sees you, \"What! How did you get loose.. er I mean I don't know you.. so uh, who are you anyway! Well, speak up!\"" );
                    System.out.println( "ENTER YOUR NAME:" );
                    name2 = keyboard.next();                   
                    System.out.println( "The girl gasps as the closet door slams behind you. \"" + name2 + ", what on earth are you doing here? Oh... no you... I can't believe it! You didn't kidnap " + name2 + "! What were you going to do with him!?\" The man stutters a bit and replies, \"Well, I, uh... You're mother and I thought...um.\" By now you have gotten loose of your blindfold and can see the pair. You recognize the girl but can't seem to place her. You're still light headed and woozy from being unconscious, and your head aches." );
                    System.out.println( "Do you \"a\" ask the girl who she is or \"b\" hit the man first and ask questions later?" );
                    q333 = keyboard.next();
                    System.out.println();
                    
                    if ( q333.equals("a") ) {
                        System.out.println( "The old man stifles a snigger. The girl goes quickly from surprised to angry. \"What! Are you kidding me? You say you don't know my name at a time like this?\" Suddenly her voice triggers something and you think you might remember her name. However, she slaps you across the face before you can say it and you pass out again." );
                        System.out.println( name2 + ", YOU JUST GOT DUMPED." );
                    }
                    
                    else if ( q333.equals("b") ) {
                        System.out.println( "You punch the old man in the face and he falls to the floor, moaning. Your hair waves heroically in the wind, which is of dubious origin. You grab the girl's hand and run out the door, leaving the old man on the floor. Together, you fly to Italy where you live out the rest of your days on the trust fund that her deceased fathyer left to her. You also managed to figure out her name by looking at her plane ticket. Until that point you survived on pet names, and somehow she didn't seem suspicious." );
                        System.out.println( "GOOD GOING, " + name2 );
                    }
                    
                    else {
                        System.out.println( "You screwed up." );
                    }
                }
                
                else if ( q22.equals("b") ) {
                    System.out.println( "While you are preparing yourself for battle you can hear the sound of some dull object pounding the girl. You find a pokey umbrella and charge out of the closet. The girl looks up at you from the corner where she is cowering. Her face suddenly brightens, \"Dad? I thought you'd gone to Canada!\" The old guy looks up at you with an expression of pure fear. \"It's-it's you!\" He runs away with a candlestick in hand." );
                    System.out.println( "Do you \"a\" chase the guy and try to take him down or \"b\" go make sure your daughter is OK?" );
                    q3333 = keyboard.next();
                    System.out.println();
                    
                    if ( q3333.equals("a") ) {
                        System.out.println( "You chase after the guy but he hides in a hallway and as you around the corner he surprises you by slamming your head with his candlestick. It's lights out for you, and for good this time." );
                        System.out.println( "LAME. YOU DIED." );
                    }
                    
                    else if ( q3333.equals("b") ) {
                        System.out.println( "You comfort your daughter who has few bruises but is otherwise all right. You still get the divorce from your wife, but take your daughter with you this time. She becomes a shepherdess at your sheep farm in Canada and you live happily ever after." );
                        System.out.println( "GOOD JOB." );
                    }
                    
                    else {
                        System.out.println( "You screwed up." );
                    }
                }
                
                else {
                    System.out.println( "You screwed up." );
                }
            }
            
            else {
                    System.out.println( "You screwed up." );
            }
        }
    }

    

Picture of the output

Assignment 1