Assignemnt #45 Choosing Your Adventure

Code

    ///Name: Prooz Fereydouni
    ///Period: 7
    ///Project Name: Choosing Your Adventure
    ///File Name: CYOA.java
    ///Date: 11/5/2015
  
import java.util.Scanner;

public class CYOA
{
public static void main( String[] args )
    {
        String answer="";
        Scanner keyboard = new Scanner(System.in);
        System.out.println("WELCOME TO PIROOZ'S ADVENTURE");
        
        System.out.println("");
        
        System.out.println("You are in a forest. There are two paths in front of you. Would you take the \"left\" path or the \"right\"?");
        answer = keyboard.next();
        
        System.out.println("");
        
        if(answer.equals("right"))
        {
            System.out.println("You have chosen the right path. You walk for 10 minutes but you hear noises behind you. You look back and see a big foot shouting. Would you \"run\" or \"stab\" it with your pocket knife?");
            answer = keyboard.next();
            
            System.out.println("");
            
            if(answer.equals("run"))
            {
                System.out.println("Wow. That was close. You run away from the big foot and you have your knife in your hand. Do you \"drop\" it or \"carry\" it with you?");
                answer = keyboard.next();
                
                System.out.println("");
                
                if(answer.equals("drop"))
            {
                System.out.println("You drop the knife carelessly and it drops on your right foot. It bleeds for 10 hours and you die.");
            }
            else if(answer.equals("carry"))
            {
                System.out.println("You carry the knife with you. You run for 2 weeks but you can't find the way out. You have been starving for days now and decide to end the suffering with your knife!");
            }
            else 
            {
                System.out.println("Wrong input.");
            }
        }
            else if(answer.equals("stab"))
            {
                System.out.println("You stab the big foot in the neck and it dies instantly. Since you don't have any food with you you have two choices; Do you \"eat\" the meat or do you \"continue\" your journey?");
                answer = keyboard.next();
                
                System.out.println("");
                
                if(answer.equals("eat"))
            {
                System.out.println("You eat the meat and you feel a sting in your stomach. You suddenly remember the famous saying \"Dont't eat big foot's meat\" and die because of the poison of the meat.");
            }
            else if(answer.equals("continue"))
            {
                System.out.println("You continue without taking the meat. You run for 2 weeks but you can't find the way out. You have been starving for days now and decide to use a rock to end your life!");
            }
            else 
            {
                System.out.println("Wrong input.");
            }
        }
            else 
            {
                System.out.println("Wrong input.");
            }
        }
        else if(answer.equals("left"))
        {
            System.out.println("You have chosen the left path. You walk for 8 minutes until you see your friend from middle school. Do you \"trust\" him and continue your journey with him or do you \"ignore\" him and walk past him?");
            answer = keyboard.next();
            System.out.println("");
            
            if(answer.equals("trust"))
            {
                System.out.println("You decide to trust your friend and go talk to him. It turns out that he has been stuck in the forest for weeks and he has turned to cannibalism. He attacks! Do you stand and \"fight\" or do you \"run\" away from him?");
                answer = keyboard.next();
                    
                System.out.println("");
                
                if(answer.equals("fight"))
            {
                System.out.println("You stand and fight. You attack him but he bites off your finger. You try to run back but he kicks your legs. He then eats you alive!");
            }
            else if(answer.equals("run"))
            {
                System.out.println("You try to run away but he has been stuck here far more than you have. He has trained more and is faster than you. He reaches you and hits you with a rock. He then eats you!");
            }
            else 
            {
                System.out.println("Wrong input.");
            }
        }
            else if(answer.equals("ignore"))
            {
                System.out.println("You decide to ignore him and walk past him. He doesn't recognize you. You find a pack of cooked meat. You don't know what kind of meat it is. Do you \"pick\" some of the meat while he isn't watching or do you \"continue\" watching");
                answer = keyboard.next();
                
                System.out.println("");
                
                if(answer.equals("pick"))
            {
                System.out.println("You pick some of the meat and eat some. You then realize that the meat is human meat! You spit it out and drop the meat. After walking for a while you feel very guilty and depressed. After a while you decide to end it and you use a rock to finish your life!");
            }
            else if(answer.equals("continue"))
            {
                System.out.println("You continue without taking the meat. After walking tirelessly for a month you find a village and you call your parents. They send you some tickets and you go home by airplane!");
            }
            else 
            {
                System.out.println("Wrong input.");
            }
        }
            else 
            {
                System.out.println("Wrong input.");
            }
    }
}
}

    

Picture of the output

assignment45