Project 1
Code
/// Name: Raff Lisbona
/// Period: 6
/// Program Name: Adventure 2
/// File Name: Adventure2.java
/// Date Finished: 11/13/2015
import java.util.Scanner;
public class Adventure2
{
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("Welcome to another adventure!");
System.out.println(" ");
System.out.println("You walk into a creepy house. Would you like to go \"upstairs\", ");
System.out.println("to the \"basement\" or in the \"kitchen\"?");
System.out.print("> ");
a1 = keyboard.next();
System.out.println(" ");
if (a1.equals("upstairs"))
{
System.out.println("You walk up the stairs and see a hallway with a door on your ");
System.out.println("right and a door at the end of the hall. Would you like to go ");
System.out.println("through the first \"door\" or down the \"hall\"?");
System.out.print("> ");
a2 = keyboard.next();
System.out.println(" ");
if (a2.equals("door"))
{
System.out.println("When you enter the door it mysteriously shuts and locks behind ");
System.out.println("you. You can either choose to be killed by a \"shark\" in a shark ");
System.out.println("tank or by trying to jump through a ring of \"fire\".");
System.out.print("> ");
a3 = keyboard.next();
System.out.println(" ");
if (a3.equals("fire"))
{
System.out.println("You get on a motorcycle and get ready for your jump. You drive ");
System.out.println("toward the ramp as fast as you can and fly through the burning ");
System.out.println("ring successfully. You then realize that there is no landing ramp ");
System.out.println("and as soon as your front tire hits the ground it explodes... your ");
System.out.println("handle bars go flying through your face and out the back of your ");
System.out.println("head. Your teeth are ground down to a powder... You die instantly... ");
System.out.println("...the next day.");
}
else if (a3.equals("shark"))
{
System.out.println("You jump into the shark tank and are instantly ripped to shreds by the ");
System.out.println("several sharks that are in the tank. Why would you choose to do this? ");
System.out.println("Who in their right mind would want to end like this? You should question ");
System.out.println("all the future decisions you make from now on. You died.");
}
}
else if (a2.equals("hall"))
{
System.out.println("You begin to walk down the hall but when you make it half way down you fall ");
System.out.println("through a trap door. The trap door leads to a deserted castle. You can either ");
System.out.println("\"climb\" the castle wall and see what's up there or you can go into the ");
System.out.println("castle \"dungeon\". Choose wisely.");
System.out.print("> ");
a4 = keyboard.next();
System.out.println(" ");
if (a4.equals("climb"))
{
System.out.println("You've climbed up the entire wall. That was impresive. You notice there is ");
System.out.println("an entire kingdom beyond the wall, it's an incredible sight! Birds are ");
System.out.println("singing, jesters are joking, knights are fighting... You want to take ");
System.out.println("a closer look. You step forward. All of a sudden a gust of wind comes ");
System.out.println("and you lose your footing. You slip and fall down the wall. You hit ");
System.out.println("the ground with such force, your skull explodes... Your bones have become");
System.out.println("a fine powder... You no longer exist as a human being but only as a type ");
System.out.println("of gross mush. You're dead.");
}
else if (a4.equals("dungeon"))
{
System.out.println("You walk down the stairs to the dungeon of the castle. The dungeon master ");
System.out.println("is startled to see someone down there. He takes is club and knocks you out. ");
System.out.println("You wake up. You have no sence of time. You could have been down there for a ");
System.out.println("night or it could have been a year. You eventually rot away in this God ");
System.out.println("forsaken place. You die a slow, painful death.");
}
}
}
else if (a1.equals("basement"))
{
System.out.println("You walk down to the basement and see a scary looking plasma on the wall. You have no ");
System.out.println("idea what the plasma 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 plasma makes you start to hallucinate and you start to freak out.");
System.out.println("You still don't know what it is but you are now tripping major balls. You look");
System.out.println("around the basement that you're in and it is very cluttered. You see a very scary ");
System.out.println("looking person and realize it is the inbread creature from Harold and Kumar. Do ");
System.out.println("you \"punch\" it in the face or \"run\" away?");
System.out.print("> ");
a6 = keyboard.next();
System.out.println(" ");
if (a6.equals("punch"))
{
System.out.println("The creatures has an extremely hard face so when you punched it you break ");
System.out.println("every bone in your hand. The creature screams at you and then eats your face");
System.out.println("off! You died.");
}
else if (a6.equals("run"))
{
System.out.println("You begin running back up the stairs but the drugs kick in even harder. While ");
System.out.println("you're running up the stairs one of the stairs turns into a small bus. You ");
System.out.println("run over the bus but feel bad so you go back and check on it but by that time ");
System.out.println("the creature in the basement has already caught up to you and is eating you." );
System.out.println("You died.");
}
}
else if (a5.equals("leave"))
{
System.out.println("You want to explore the basement a little more so you walk around. You see a small");
System.out.println("trap door in the floor of the basement. Do you \"enter\" it or \"leave\" it?");
System.out.print("> ");
a7 = keyboard.next();
System.out.println(" ");
if (a7.equals("enter"))
{
System.out.println("You go into the trap door and find youself in a whole new room. The room has ");
System.out.println("a couch, a TV, and an Xbox in it. It also has all the snacks you could ever ");
System.out.println("want. You decide to spend out the rest of your days in the room. You end up ");
System.out.println("dying an old man on your own playing video games your whole life.");
}
else if (a7.equals("leave"))
{
System.out.println("You leave the trap door and keep exploring. You find an old guillotine and ");
System.out.println("decide that it would be really cool to try putting your head in it. When you ");
System.out.println("do this the machine accidentally goes off and your head is chopped off.");
}
}
}
else if (a1.equals("kitchen"))
{
System.out.println("You walk into the kitchen and see a refridgerator and a cabinet. Do you open the ");
System.out.println("\"fridge\" or the \"cabinet\"?");
System.out.print("> ");
a8 = keyboard.next();
System.out.println(" ");
if (a8.equals("fridge"))
{
System.out.println("You open the fridge and see an entire pizza inside it. Would you like to \"eat\" ");
System.out.println("the pizza or \"leave\" it for whoever bought it.");
System.out.print("> ");
a9 = keyboard.next();
System.out.println(" ");
if (a9.equals("eat"))
{
System.out.println("You start chowing down on this pizza. It's probably the best pizza you've ");
System.out.println("eaten. But after you've finished it you start to feel a stomach ache. It ");
System.out.println("turns out that the pizza was poisoned and you fall on the ground and die.");
}
else if (a9.equals("leave"))
{
System.out.println("You decided not to eat the pizza but you had already not eaten anything ");
System.out.println("for the past 8 days because you were fasting. You die of starvation.");
}
}
else if (a8.equals("cabinet"))
{
System.out.println("You open the cabinet and there is a baby octopus in it. The octopus jumps out of ");
System.out.println("the cabinet and attatches itself to your face. You manage to grab a clever and ");
System.out.println("hack the octopus to bits. Do you decide to \"cook\" it and eat it or \"feed\" it");
System.out.println("to the angry dogs that are outside?");
System.out.print("> ");
a10 = keyboard.next();
System.out.println(" ");
if (a10.equals("cook"))
{
System.out.println("You fry up the octopus and begin to eat it. You then realize that this octopus");
System.out.println("is highly poisonous. You imediatly fall on the ground dead.");
}
else if (a10.equals("feed"))
{
System.out.println("You open the door of the house to feed the dogs that are outside but all of ");
System.out.println("the dogs push open the door and quickly eat you without giving you a chance ");
System.out.println("to feed them first.");
}
}
}
}
}
Picture of the output