Project Number 1 and Choose Your Own Slightly Longer Adventure!
Code
/// Name: Brendan Baird
/// Period: 6
/// Program Name: Choose Your Own Slightly Longer Adventure!
/// File Name: LongAdventure.java
/// Date Finished: 10/29/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("LET'S BEGIN YOUR ADVENTURE!");
System.out.println();
System.out.println("You wake up in a thick forest. You see a dirt path near a cave. Would you like to go to the \"path\", \"cave\", or deeper into the \"forest\"?");
choiceA = keyboard.next();
System.out.println();
if (choiceA.equals("path"))
{
System.out.println("You continue the along the path until you reach a split. You can go either \"left\" or \"right\".");
choiceA1 = keyboard.next();
System.out.println();
if (choiceA1.equals("left"))
{
System.out.println("You see a bear as you go along the path. Do want to continue down this path? (\"yes\" or \"no\")");
choiceA1a = keyboard.next();
System.out.println();
if (choiceA1a.equals("yes"))
{
System.out.println("You are passing by the bear when he begins to the sing the song of his ancestors. You are inspired by Bear Bard and live the rest of your days in his band.");
}
else if (choiceA1a.equals("no"))
{
System.out.println("You try to turn back but the path dissapears! You eventually die of thirst.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA1.equals("right"))
{
System.out.println("You find a lake filled with bathing women. Do you want to bathe with them? (\"yes\" or \"no\")");
choiceA1b = keyboard.next();
System.out.println();
if (choiceA1b.equals("yes"))
{
System.out.println("You proudly clean your tattered clothes in the lake as the women crowd around. They are flesh-eating Sirens, and they eat you for dinner.");
}
else if (choiceA1b.equals("no"))
{
System.out.println("You turn back only to tread on a snake. The snake is infuriated and scolds you. You are so depressed by this that you lose all drive to continue your adventure.");
}
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 enter the cave and find a treasure chest next to a path that further down. Do you want to go to the \"chest\" or \"deeper\"?");
choiceA2 = keyboard.next();
System.out.println();
if (choiceA2 == "chest")
{
System.out.println("As you approach the chest, you notice there's no lock, but have an unsettling feeling that the chest is dangerous. Do you want to open the chest? (\"yes\" or \"no\")");
choiceA2a = keyboard.next();
System.out.println();
if (choiceA2a.equals("yes"))
{
System.out.println("You open the chest with ease, but only to find the fanged mouth of a mimic! The chest isn't a chest at all, and it devours you immediately!");
}
else if (choiceA2a.equals("no"))
{
System.out.println("You continue to wander the cave and fight monsters until you reach level 2. After a good day of XP grinding, you replenish your HP and become a Dungeon Boss.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA2.equals("deeper"))
{
System.out.println("The cave grows darker as you progress down. Eventually you find a door at the end of the cave. Open the door? (\"yes\" or \"no\")");
choiceA2b = keyboard.next();
System.out.println();
if (choiceA2b.equals("yes"))
{
System.out.println("Your heart is racing as you slowly open the door. You are astonished to find a room full of computers, tvs, and pizza; it is the ultimate man cave! You live the rest of your days in bliss.");
}
else if (choiceA2b.equals("no"))
{
System.out.println("In your defiant determination to not progress the story, you choose to stand where you are for two eternities. Stubborn prick.");
}
else
System.out.println("That is not a destination.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA.equals("forest"))
{
System.out.println("Your spirited and uncomforming attitude towards life makes it obvious how superior you are to everyone else. You see a cabin near a the bottom of a cliff. Go to \"cabin\" or \"cliff\"?");
choiceA3 = keyboard.next();
System.out.println();
if (choiceA3.equals("cabin"))
{
System.out.println("You enter the cabin to find Henry Thoreau working on an essay. Talk to Thoreau? (\"yes\" or \"no\")");
choiceA3a = keyboard.next();
System.out.println();
if (choiceA3a.equals("yes"))
{
System.out.println("You converse all day about not conforming to stuff with Thoreau, and become a Transcendentalist.");
}
else if (choiceA3a.equals("no"))
{
System.out.println("You stare intensely at Thoreau for many hours, and he grows nervous. Eventually you become a an eyeball and roam the Earth.");
}
else
System.out.println("That is not a destination.");
}
else if (choiceA3 == "cliff")
{
System.out.println("You begin to climb the narrow cliff until you can no longer hold on from your lack of endurance. Do you let go? (\"yes\" or \"no\")");
choiceA3b = keyboard.next();
System.out.println();
if (choiceA3b.equals("yes"))
{
System.out.println("You think of your family, your friends, your crush - or at least you try to until you realize that you can't remember anything. Your life was so short. You let go. You were only able to climb like 3 feet so you are fine.");
}
else if (choiceA3b.equals("no"))
{
System.out.println("You look for another way, and luckily find nook in the cliff to rest. You wait there until you have regained your strength and then fly away into the sunset.");
}
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