If statement part 2 #44 (You'll die laughing)

Code

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


import java.util.Scanner;

public class ChooseYourAdventure {

    public static void main(String[] args) {

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

        System.out.print("You are stuck in the middle of the ocean with a raft. You don't remember how you got here or where you are, but there's a bag and a paddle near you. Do you \"search\" or \"paddle\"?\n> ");
        choices[0] = input.nextLine();

        if (choices[0].equalsIgnoreCase("search")) {
            System.out.print("In the raft yout find a Flare gun and a Fishing rod. Do you pick up the \"Flaregun\" or \"Fishingrod\"?\n> ");
            choices[1] = input.nextLine();

            if (choices[1].equalsIgnoreCase("Flaregun")) {
                System.out.print("You pick up the flare gun, but it is sunny outside, do you shoot it or do nothing? \"Shoot\" or \"Nothing\"?\n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("Shoot")) {
                    System.out.println("After shooting the Flare gun miraculously a nearby plane saw you, 5 hours later you are picked up by a ship and are returning back home.\n\nGOOD END");
                } else {
                    System.out.println("After doing nothing (Like the idiot your are) a bird steals your flare gun, you are stuck in the ocean for eternity. (Plus you may have died from dehydration) \n\nBAD END");
                }
            } else {
                System.out.print("After finding the fishing rod you decided to go fishing and you caught a fish. Do you eat it? \"Yes\" or \"no\"?\n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("yes")) {
                    System.out.println("The fish you've eaten contained large amounts of mercury. You died from mercury poisoning.\n\nBAD END");
                } else {
                    System.out.println("Too bad, because that fish attracted sharks. The sharks start knawling on your boat and your boat starts to sink. Welp it looks like you are fish food now.\n\nBAD END");
                }
            }
        } else {
            System.out.print("You start to paddle you've noticed an island in the distance. Do you \"land\" or \"pass\" on the island?\n> ");
            choices[1] = input.nextLine();

            if (choices[1].equalsIgnoreCase("land")) {
                System.out.print("You have sucessfully landed on the island. There is a tree with cocanuts. Do you \"stay\" on the island or \"leave\"?\n> ");

                choices[2] = input.nextLine();
                if (choices[2].equalsIgnoreCase("stay")) {
                    System.out.println("You've stayed on the island. However, you ran out of cocanuts in fifth day (Should've eaten so many.) You died due to the lack of cocanuts.\n\nBAD END");
                } else {
                    System.out.println("As you try to head back to your raft it is missing. It seems as if the waves has taken your raft out to sea. You died due to the lack of food in the island and now you are food for the seagulls. (Should've taken better care of that raft.)\n\nBAD END");
                }
            } else {
                System.out.print("You've passed the island. However, it seems that there's a storm heading you way. Do you \"paddle\" or \"wait\" out the storm?\n> ");
                choices[2] = input.nextLine();

                if (choices[2].equalsIgnoreCase("paddle")) {
                    System.out.println("As you paddle towards the storm it seems bigger since you are closer. Unlike the life of Pie you didn't survive the storm and you were either killed by a 10 story high wave or by drowned after surviving from it.\n\nBAD END");
                } else {
                    System.out.println("After you decided to wait out the storm you fell asleep. As soon as you've awoken you've surpisingly survived the storm, but since you smell like fish the seagulls have attacked you and have eaten your remains. (Never trust a rat with wings) \n\nBAD END");
                }
            }
        }

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

    }

}
    

Picture of the output

Assignment 7

Back to Homepage