Project
Code
/// Gian Adoremos
/// Period: 7
/// Program Name: Project
/// File Name: LongAdventure.java
/// Date Finished: 11/19/2015
import java.util.Scanner;
public class LongAdventure
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String choiceA, choiceA1, choiceA1a, choiceA1b, choiceA2, choiceA2a, choiceA2b, choiceA3, choiceA3a, choiceA3b;
System.out.println("WELCOME TO THE GREATEST ADVENTURE OF ALL TIME!");
System.out.println();
System.out.println("You hear a sound coming from the hallway in your house. Do you go out and \"check\", \"ignore \" it, or \"scream\" in fear?");
choiceA = keyboard.next();
System.out.println();
if (choiceA.equals("check"))
{
System.out.println("You go out and see footprints. You decide to \"follow\" the footprints or \"clean\" up the mess.");
choiceA1 = keyboard.next();
System.out.println();
if (choiceA1.equals("follow"))
{
System.out.println("You see the prints lead to the garage. Do you continue? (\"yes\" or \"no\")");
choiceA1a = keyboard.next();
System.out.println();
if (choiceA1a.equals("yes"))
{
System.out.println("You forgot that you didn't have a garage because you are homeless and were just hallucinating the whole thing and go back to sleep in your cardboard house.");
}
else if (choiceA1a.equals("no"))
{
System.out.println("You go back to bed.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA1.equals("right"))
{
System.out.println("You go and get the mop in the closet. You see that the footprints lead to the closet. Do you still get it?(\"yes\" or \"no\")");
choiceA1b = keyboard.next();
System.out.println();
if (choiceA1b.equals("yes"))
{
System.out.println("You forgot that you are homeless and don't own a mop. You were just hallucinating the whole thing and go back to sleep in your cardboard house.");
}
else if (choiceA1b.equals("no"))
{
System.out.println("You go back to bed.");
}
else
System.out.println("That is not a destination.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA.equals("ignore"))
{
System.out.println("As you walk back to bed you hear screaming.Do you (\"ignore again\" or \"check\")?");
choiceA2 = keyboard.next();
System.out.println();
if (choiceA2 == "ignore again")
{
System.out.println("You ignore the scream, but then you feel breathing behind your head. Do you (\"look \" or \"ignore\")");
choiceA2a = keyboard.next();
System.out.println();
if (choiceA2a.equals("look"))
{
System.out.println("It is your dog and you fall asleep.");
}
else if (choiceA2a.equals("ignore"))
{
System.out.println("You fall asleep forever.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA2.equals("deeper"))
{
System.out.println("You keep swimming, you check your oxygen levels to make sure they are good. You see they are halfway, would you like to continue? (\"yes\" or \"no\")");
choiceA2b = keyboard.next();
System.out.println();
if (choiceA2b.equals("yes"))
{
System.out.println("You keep swimming until you find a strange rock, you touch it and become a fish for the rest of your life.");
}
else if (choiceA2b.equals("no"))
{
System.out.println("You swim back to land to live another day.");
}
else
System.out.println("That is not a destination.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA.equals("cave"))
{
System.out.println("You find a cave nearby and think about going inside or checking around to make sure. Do you want to go \"inside\" or \"outside\"?");
choiceA3 = keyboard.next();
System.out.println();
if (choiceA3.equals("inside"))
{
System.out.println("You enter the cave to find a TV. Would you like to watch? (\"yes\" or \"no\")");
choiceA3a = keyboard.next();
System.out.println();
if (choiceA3a.equals("yes"))
{
System.out.println("You watch tv until you die.");
}
else if (choiceA3a.equals("no"))
{
System.out.println("You look at the TV even though it is off.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA3 == "outside")
{
System.out.println("You walk around the cave and find another entrance. Do you go in? (\"yes\" or \"no\")");
choiceA3b = keyboard.next();
System.out.println();
if (choiceA3b.equals("yes"))
{
System.out.println("You go in and find a giant TV and watch it until you die.");
}
else if (choiceA3b.equals("no"))
{
System.out.println("You continue walking past the cave until you meet bears and they eat you.");
}
else
System.out.println("That is not a destination.");
}
else
System.out.println("That is not a destination.");
}
else
System.out.println("That is not a destination.");
}
}
Picture of the output