Assignment 45

Code

    import java.util.Scanner;

    public class Adventure
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            
            String c1, c2, c3, c4, c5, c6, c7;
            
            System.out.println("You about to get rekt");
            System.out.println();
            System.out.println("You wake up in a basement. Would you like to go \"upstairs\" or to the \"outside\"?");
            c1 = keyboard.next();
            
            System.out.println();
            
            if (c1.equals("upstairs"))
            {
                System.out.println("You walk upstairs into a dark room. You could go to the \"outside\" or continue in the dark \"continue\".");
                c2 = keyboard.next();
                
                System.out.println();
                
                if (c2.equals("outside"))
                {
                    System.out.println("You walk outside. You should probably leave, but you can stay. (\"leave\" or \"stay\")");
                    c3 = keyboard.next();
                    
                    System.out.println();
                    
                    if (c3.equals("leave"))
                    {
                        System.out.println("You leave the abandoned house. You don't get any closure, later.");
                    }
                    else if (c3.equals("stay"))
                    {
                        System.out.println("You stay for whatever reason and the paranoia gets to you, driving you to insanity.");
                    }
                }
                else if (c2.equals("continue"))
                {
                    System.out.println("You find a light switch. There are broken pictures everywhere and some drag marks on the floor. Would you like to investigate the clues or continue in the house? (\"investigate\" or \"continue\")");
                    c4 = keyboard.next();
                    
                    System.out.println();
                    
                    if (c4.equals("investigate"))
                    {
                        System.out.println("You look through the pictures and at the drag marks but you are hit from behind. You should just give up on games.");
                    }
                    else if (c4.equals("continue"))
                    {
                        System.out.println("You continue searching around the house to find several dead bodies, with a villain to add you to them. Curiosity isn't the best.");
                    }
                }
            }
            else if (c1.equals("outside"))
            {
                System.out.println("You are lead to a fenced off backyard, do you want to \"jump\" the fence or \"investigate\"?");
                c5 = keyboard.next();
                
                System.out.println();
                
                if (c5.equals("tv"))
                {
                    System.out.println("The fence is fairly rusted and is barbed at the top, do you want to continue doing this? (\"yes\" or \"no\")");
                    c6 = keyboard.next();
                    
                    System.out.println();
                    
                    if (c6.equals("yes"))
                    {
                        System.out.println("You get a running start and climb up and almost over, but your back is ripped by the barbed wire.");
                    }
                    else if (c6.equals("no"))
                    {
                        System.out.println("You stop and ponder in your thoughts, and eventually find a hole in the fence. Nice job.");
                    }
                }
                else if (c5.equals("investigate"))
                {
                    System.out.println("You find a glitch in the system. Investigate it further? (\"yes\" or \"no\")");
                    c7 = keyboard.next();
                    
                    System.out.println();
                    
                    if (c7.equals("yes"))
                    {
                        System.out.println("You get pulled into the matrix. I'm not supposed to be talking in 1's and 0's, talk to the computer for that.");
                    }
                    else if (c7.equals("no"))
                    {
                        System.out.println("You live you're life in an imaginary world. Or is it?");
                    }
                }
            }
        }
    }
    

Picture of the output

Assignment