project 1

Code

/// Name: Sam Menar
/// Period: 6
/// Program Name: Project1
/// File Name: Project1.java
/// Date Finished: 11/13/2015

import java.util.Scanner;
public class Project1
{
    public static void main( String[] args )
    {
        String a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
        
        Scanner keyboard = new Scanner(System.in);
        
        System.out.println("Dis game ight i guess");
        System.out.println(" ");
        System.out.println("You wake up on a deserted island. You have three options. ");
        System.out.println("You can walk towards the trees and into \"jungle\", walk into the \"cave\"");
        System.out.println("or you can \"look\" around.");
        System.out.print("> ");
        a1 = keyboard.next();
        System.out.println(" ");
        
        if (a1.equals("jungle"))
        {
            System.out.println("You walk towards the jungle until you stumble upon a dead body. ");
            System.out.println("Do you \"check\" the body or \"leave\" it alone?");
            System.out.print("> ");
            a2 = keyboard.next();
            System.out.println(" ");
            
            if (a2.equals("check"))
            {
                System.out.println("You are starving and need to eat something soon.");
                System.out.println("You can either \"eat\" the meat off the dead body or you ");
                System.out.println("can \"continue\" to walk into the jungle.");
                System.out.print("> ");
                a3 = keyboard.next();
                System.out.println(" ");
                
                if (a3.equals("eat"))
                {
                    System.out.println("The meat was rotten and you get sick and die. That was pretty dumb of you ");
                    System.out.println("to eat the dead guy. I guess you do deserve to die then. LOL ");

                }
                else if (a3.equals("continue"))
                {
                    System.out.println("You continue into the jungle and get eaten by a wild polar bear. Good job. ");

                }
            }
            else if (a2.equals("leave"))
            {
                System.out.println("You keep walking into the jungle and you find a TREASURE CHEST! Do you  ");
                System.out.println("\"open\" the chest or keep \"walking\"? ");
                System.out.print("> ");
                a4 = keyboard.next();
                System.out.println(" ");
                
                if (a4.equals("open"))
                {
                    System.out.println("It was a booby trap and it exploded and killed you turning you into ");
                    System.out.println("a bunch of tiny little meat bits. LOL. ");

                }
                else if (a4.equals("walking"))
                {
                    System.out.println("Did you seriously walk past a chest without opening it? You're kind of a ");
                    System.out.println("loser for doing that. GAME OVER LOSER, YOU'RE DONE. ");
                }
            }
        }
        else if (a1.equals("cave"))
        {
            System.out.println("You walk into the cave and see some wierd goo on the wall. You have no ");
            System.out.println("idea what it is. Do you \"smell\" it to see what it is or \"leave\" it alone?");
            System.out.print("> ");
            a5 = keyboard.next();
            System.out.println(" ");
            
            if (a5.equals("smell"))
            {
                System.out.println("The smell of the goo makes you woozy. You start seeing giant evil");
                System.out.println("penguins! Do you \"fight\" them or \"run \" away?");
                System.out.print("> ");
                a6 = keyboard.next();
                System.out.println(" ");
                
                if (a6.equals("fight"))
                {
                    System.out.println("The penguin has an extremely hard body so when you punch it you break ");
                    System.out.println("your hand. The penguin then eats you. You died.");
                }
                else if (a6.equals("run"))
                {
                    System.out.println("You run for the exit of the cave but the goo makes it unable for you ");
                    System.out.println("To run straight. It turns out the penguins were real. They eat you and you die");
                }
            }
            else if (a5.equals("leave"))
            {
                System.out.println("You keep exploring the cave until you find a giant foot from a large creature");
                System.out.println("You are unsure of what kind of animal it is. Do you \"poke\" it or do ");
                System.out.println("you \"throw\" stuff at it becuase your a dumb person?");
                System.out.print("> ");
                a7 = keyboard.next();
                System.out.println(" ");
                
                if (a7.equals("poke"))
                {
                    System.out.println("You poke the animal, which turns out to be a bear. He gets angry and eats you.");
                }
                else if (a7.equals("throw"))
                {
                    System.out.println("You're kind of a dumb idiot for throwing stuff at the animal. It turns out ");
                    System.out.println("to be a giant goose and it pecks your eyes out and you die. ");
                }
            }
        }
        else if (a1.equals("look"))
        {
            System.out.println("You look around and you see an odd looking tree. You go up to it and you see ");
            System.out.println("a potato. Do you \"eat\" it or do you \"throw\" it? ");
            System.out.print("> ");
            a8 = keyboard.next();
            System.out.println(" ");
            
            if (a8.equals("eat"))
            {
                System.out.println("You eat the potato but it tastes strange. You see a vision of a man, who asks ");
                System.out.println("if you would like... another one? \"yes\" or \"no\"?");
                System.out.print("> ");
                a9 = keyboard.next();
                System.out.println(" ");
                
                if (a9.equals("yes"))
                {
                    System.out.println("You take another one and then Dj Khaled appears and tells you that you  ");
                    System.out.println("have found the key to success. You win");
                }
                else if (a9.equals("no"))
                {
                    System.out.println("Why wouldn't you take another one? Becuase of this you die from an unknown cause ");

                }
            }
            else if (a8.equals("throw"))
            {
                System.out.println("You throw the potato whcih turns into a transformer. Do you choose \"autobots\" ");
                System.out.println("or do you choose to be \"decepticons\"? ");
                System.out.print("> ");
                a10 = keyboard.next();
                System.out.println(" ");
                
                if (a10.equals("autobots"))
                {
                    System.out.println("Lol jk it turns into a giant angry turtle that eats you alive. you die");
                }
                else if (a10.equals("decepticons"))
                {
                    System.out.println("the potato turns into megatron who kills you, becaue he is a bad guy. ");
                }
            }
        }
    }
}

    

Picture of the output

Assignment 13