Projekt Nunbar #1 ()

Code

/// Name: Amir Salehi
/// Period: 7
/// Program Name: Choose Your Own Adventure
/// File Name: ChooseYourOwnAdventure.java
/// Date Finished: Oct 27, 2015

import java.util.Scanner;

public class ChooseYourOwnAdventure {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        String[] choices = new String[3]; 


        System.out.print("Your are in a cell. It seems as if you're in prison, You'll need to escape! Do you \"Look\"for another prisoner, \"File\" through the bars or \"Dig\" a hole to tunnel your escape?\n> ");
        choices[0] = input.nextLine();

        if (choices[0].equalsIgnoreCase("Look")) {
            System.out.print("As you look around your cell you've noticed your cell mate sleeping in the top bunk. Do you keep \"Looking\" for another prisoner or \"Call\" your cellmate?\n> ");
            choices[1] = input.nextLine();

            if (choices[1].equalsIgnoreCase("Looking")) {
                System.out.print("At lunch time in the prison you've noticed a ripped prisoner with piercings sitting at a table. Do you call him over? \"Call\" or \"Nothing\"?\n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("Call")) {
                    System.out.println("After Calling the man, you've realized you weren't using your inside voice, he comes to you and says, What do you want Little fish?. You were intimidated by him ripped body and size, so you've decided not to speak. The ripped man then gets angry for wasting his time and he pounds you into a pulp. (Heh, Orange Juice) All your bones were broken and you've spent must of your jail time in the Infirmary\n\nBAD END");
                } else {
                    System.out.println("After doing nothing your will power diminished. Probably because of your Social Phobia you couldn't talk to people. After spending time in prison everyone called you Silent Steve (even though that's not your name), and you were often beaten up because of that. (Probably because you were silent Roll Call.) \n\nBAD END");
                }
            } else {
                System.out.print("After calling your Cellmate he wakes up. Then he comes down from his bunk and asks you What do you want? Do you \"Tell\" him the escape plan or say that it's \"Nothing\"?\n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("Tell")) {
                    System.out.println("You tell him about the escape plan and he nods in response. The day after that he big mouthed your plans over to the other prisoners and some of the guards overheard that discussion. Later you were thrown into solitary confinement for the rest of your jail time. (Never Trust a loud mouth) \n\nBAD END");
                } else {
                    System.out.println("After your told him that it was nothing, he suddenly gets pissed off because you've awoken him from his sleep. Later at night, when you were sleeping you heard somebody say Hey Wake up! You open your eyes and looked up. You get a quick glance of your Cellmate holding a pillow before he suffocates you with it. (Never wake up somebody in the middle of their sleep, they get grumpy after.) \n\nBAD END");
                }
            }
        }  else if (choices[0].equalsIgnoreCase("File")) {
            System.out.print(" You see that there are bars in your cell and on the window. Which one do you choose? \"Cell\" or \"Window\" ?\n> ");
            choices[1] = input.nextLine();

            if (choices[1].equalsIgnoreCase("Cell")) {
                System.out.print("As you wait till nightfall you start filing through your bars. Surprisingly it took about 45 mins. As you filed through the cell you can finally walk through? Do you \"Attempt\" to escape now or \"Wait\" until morning?\n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("Attempt")) {
                    System.out.println("As you escaped your cell you decided walk down the hallway. Then.... suddenly.... A guard swoops down from the floor above and tries to beat you down. You try to fight, but he throws you over the bars. Time slows down as you fell down to your death. (Damn, these guards must be like ninjas or something. I guess that why they call them Night-Guard (Yea I know bad puns).) \n\nBAD END");
                } else {
                    System.out.println(" So, you wait till morning, needless to say you got thrown in solitary, because as soon as the guard walked by you fell asleep next to the filed bar. (Should've blamed it on your cellmate) \n\nBAD END");
                }
            } else {
                System.out.print("As soon as night falls you've successfully filed through the window under 3 hours. You decided to go out of the filed window. You see a tower and the courtyard. Do you escape through the \"Courtyard\" or the watch \"Tower\"? \n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("Courtyard")) {
                    System.out.println("You go down to the courtyard, then suddenly a white circle surrounds you. You are spotted by a spotlight from one of the towers. As you try to run towards the gate a guard wielding and riding a horse starts galloping towards you. The last words you've ever heard before you were decapitated were, YOU SHALL NOT PASS! ( I've forgot that Gandalf was working the night shift.) \n\nBAD END");
                } else {
                    System.out.println("After you've decided to get to the tower, you've climbed the water pipe up. You've made it and you quickly knocked out the guards with your file. You see that there is a wire that leads outside prison. You find a coat hanger and sucessfully ziplined out of the prison. ( Escapist Rank: Ninja) \n\nGOOD END");
                }
            }
        } else {
            System.out.print("You've decided to dig, but you need something to dig with. Do you go to the \"Factory\" or \"Kitchen\" of the prison?\n> ");
            choices[1] = input.nextLine();

            if (choices[1].equalsIgnoreCase("Factory")) {
                System.out.print("You've decided to go to the factory. As you went there you've noticed an object that could be used as a pick, but it's surrounded by other inmates. Do you \"Bribe\" them or \"Steal\" from them?\n> ");

                choices[2] = input.nextLine();
                if (choices[2].equalsIgnoreCase("Bribe")) {
                    System.out.println("You've bribed them and you've made an offer that they couldn't refuse. After day 5 of picking your way of escape you've died. (Did the offer included all of your meals and your life?) You died due to starvation.\n\nBAD END");
                } else {
                    System.out.println("You stole the pick from them. You thought you got away with it except when you walked down the dark hallway a pack of cellmates shanked you and ran away. ( Not a good start to make some friends.)\n\nBAD END");
                }
            } else {
                System.out.print("You've made it to the kitchen, there you see a cup filled with metal Spoons, knifes and forks. Now you are rethinking your stragety, because the truck that dropped off food outside and it's still there plus there's an empty crate right beside it. Do you \"Take\" the spoons or \"Get\" inside the crate?\n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("Take")) {
                    System.out.println("You've taken the spoons, luckily this prison is too poor to buy metal detectors. On the day that you've broken 900 Metal spoons it was due for a cell inspection. After the guards were looking in your cell you heard a voice that said, OH thats where all the spoon went. You've died, because apparently the amount of spoons you've broken was more expensive than your life. (Death by Spoons)\n\nBAD END");
                } else {
                    System.out.println("You quickly hopped in the crate when nobody was looking, but as you felt around you've wondered why is there plastic all around. Suddenly you hear a vacum and the plastic around you started to compress you. You've died due to suffocation. (Hey look! A newly airtight packaged Inmate action figure, OH BOY!(I guess that what it feels like to become an action figure)) \n\nBAD END");
                }
            }
        }

        System.out.println("\nThank you for playing!");

    }

}
    

Picture of the output

Assignment 7

Back to Homepage