Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class EscapeRoom{
- public static String password = "Pw08191976";
- public static boolean on = false;
- public static String userName = "";
- public static void main(String[] args) throws InterruptedException{
- Scanner console = new Scanner(System.in);
- //intro();
- userName = getUsername();
- description();
- puzzle0();
- String input = console.nextLine();
- while(!input.equalsIgnoreCase("Quit")){
- input = console.nextLine();
- }
- }
- public static void intro() throws InterruptedException{
- System.out.println("As you gradually open your eyes, you realize ");
- Thread.sleep(2300);
- System.out.println("you are in Mr.Binz' AP Java classroom.");
- Thread.sleep(2300);
- System.out.println("While rubbing the weariness from your eyes, ");
- Thread.sleep(2300);
- System.out.println("you notice that it is pitch black outside.");
- Thread.sleep(2300);
- System.out.println("You get up slowly and casually walk to the exit ");
- Thread.sleep(2300);
- System.out.println("only to grasp that it's locked.");
- Thread.sleep(2300);
- System.out.println("");
- System.out.println("╔══════════════════════╗");
- System.out.println("\tEscape Room");
- System.out.println("\tJuan HeeSoo");
- System.out.println("╚══════════════════════╝");
- System.out.println("");
- }
- public static String getUsername() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- Thread.sleep(750);
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬");
- Thread.sleep(750);
- System.out.println("Enter a username: ");
- String name = console.next();
- Thread.sleep(750);
- System.out.println("Welcome to the Escape Room");
- System.out.println("\t" + name);
- Thread.sleep(500);
- System.out.println("");
- Thread.sleep(500);
- System.out.println("Enter 'quit' to quit");
- Thread.sleep(750);
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬");
- Thread.sleep(750);
- System.out.println("");
- return name;
- }
- public static void description() throws InterruptedException{
- Thread.sleep(950);
- System.out.println("Suddenly the TV flickers to life!");
- Thread.sleep(1900);
- System.out.print("Behind a wall of static, you notice a figure");
- dots();
- Thread.sleep(2350);
- System.out.println("▬[Mr Binz]▬▬▬▬▬▬▬▬▬▬▬▬ ");
- System.out.println("Hello there, " + userName );
- Thread.sleep(750);
- System.out.println("It seems like you have awoken. ");
- Thread.sleep(750);
- System.out.println("You're currently in room 334 taking part in my little expirement.");
- Thread.sleep(750);
- System.out.println(" To get out of my room, ");
- Thread.sleep(750);
- System.out.println("you will need to solve a series of puzzles.");
- Thread.sleep(750);
- System.out.println("Good luck, player");
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ");
- Thread.sleep(700);
- System.out.println("Suddenly, the TV blacks out!");
- Thread.sleep(700);
- System.out.println("Hint: Use 'observe' to look around");
- }
- public static void puzzle0() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- if (command.equalsIgnoreCase("observe")) {
- System.out.println("It seems like the same computer room you come");
- Thread.sleep(2250);
- System.out.println("to everyday. In the vicinity you see the SHELF,");
- Thread.sleep(2250);
- System.out.print("COMPUTERS, DOOR, and a TV");
- dots();
- System.out.println("Why don't you 'look' around?(Hint:look object)");
- puzzle1();
- } else if(!command.equalsIgnoreCase("observe")) {
- System.out.println("Unknown command registered!");
- System.out.println("Hint: Use 'observe' to look around");
- puzzle0();
- }
- }
- public static void puzzle1() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("look")) {
- if (object.equalsIgnoreCase("shelf")) {
- System.out.print("There seems to be a few MUGS and BINDERS");
- dots();
- Thread.sleep(2500);
- System.out.println("Suddenly, you feel a breeze coming from behind the shelf!");
- Thread.sleep(800);
- System.out.println("What will you do?");
- puzzle1a();
- } else if (object.equalsIgnoreCase("computers")) {
- System.out.print("You walk over to the computer and power it on");
- dots();
- Thread.sleep(1950);
- System.out.println("It looks like its locked!");
- Thread.sleep(1950);
- System.out.println("It needs a password");
- puzzle1();
- } else if (object.equalsIgnoreCase("door")) {
- System.out.println("You walk over to the door and try the handle.");
- Thread.sleep(1950);
- System.out.println("It seems to be locked!");
- Thread.sleep(1950);
- System.out.print("You peek out the windows, into the hallway");
- dots();
- Thread.sleep(1950);
- System.out.println("It's too dark to notice anything.");
- Thread.sleep(1950);
- System.out.println("As you take a step back, you notice a protruding keyhole,");
- System.out.println("under the handle.");
- puzzle1();
- } else if (object.equalsIgnoreCase("tv")) {
- System.out.println("You walk over to the tv.");
- Thread.sleep(1950);
- System.out.print("It seems like an old box tv");
- dots();
- System.out.println("Several BUTTONs seem to be lining the bottom.");
- System.out.println("It seems be within a 'push' distance!");
- puzzle1e();
- }
- }
- }
- public static void puzzle1e() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("push")) {
- if (object.equalsIgnoreCase("button")) {
- System.out.println("You push the power button on the TV.");
- Thread.sleep(1950);
- System.out.println("Nothing seems to happen.");
- Thread.sleep(1950);
- System.out.println("You try the other buttons.");
- Thread.sleep(1950);
- System.out.print("It seems to be dead");
- dots();
- puzzle1();
- }
- }
- }
- public static void puzzle1a() throws InterruptedException{
- System.out.println("Hint: There seems to be something behind the SHELF!");
- Thread.sleep(2250);
- System.out.print(" Maybe you can 'push' it out of the way");
- dots();
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("push")) {
- System.out.println("You push the shelf to find a dark, dusty room");
- Thread.sleep(2250);
- System.out.println("Within it, a lone table stands");
- Thread.sleep(2250);
- System.out.println("You see a thick BOOK sitting on top of it");
- puzzle1b();
- } //else if(commad.equalsIgnoreCase("look")) {
- //}
- else if(!command.equalsIgnoreCase("push")) {
- System.out.println("Unknown command registered!");
- Thread.sleep(2250);
- System.out.println("Hint: There seems to be something behind the shelf!");
- Thread.sleep(2250);
- System.out.print(" Maybe you can push it out of the way");
- dots();
- puzzle0();
- }
- }
- public static void puzzle1b() throws InterruptedException{
- System.out.println("You lift the heavy cover of the book and wipe off the coat of dust.");
- Thread.sleep(1950);
- System.out.println("On the cover it reads 'AP Java Class of 11111001011'"); //1995
- Thread.sleep(1950);
- System.out.println("As you begin to flip through the pages, you see the names and pictures of several students,");
- Thread.sleep(1950);
- System.out.println("who you don't recognize. Suddenly, a note falls to the ground.");
- Thread.sleep(1950);
- System.out.println("Dear Nathan, 19th Birthday. Congrats on your graduation."); //happy birthday note. August 19 1976 from sidechar1 name later
- Thread.sleep(1950);
- System.out.println("Hopefully you had a good 2 months off of school. I'm sending this on the 14th because");
- Thread.sleep(1950);
- System.out.println("it usually takes around 5 days for my mail to get to you. Hopefully you get this on your");
- Thread.sleep(1950);
- System.out.println("birthday. From sidechar1.");
- dots();
- puzzle1c();
- }
- public static void puzzle1c() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("look")) {
- if (object.equalsIgnoreCase("shelf")) {
- System.out.print("There seems to be a few MUGS and BINDERS");
- dots();
- Thread.sleep(2500);
- System.out.println("You have already searched this room, ");
- Thread.sleep(1500);
- System.out.println("would you like to look through it again?");
- puzzle1f();
- } else if (object.equalsIgnoreCase("computers")) {
- System.out.print("You walk over to the computer and power it on");
- dots();
- Thread.sleep(1950);
- System.out.println("On the bottom right corner a notification pops up");
- Thread.sleep(1950);
- System.out.println("The screen prompts for a password");
- Thread.sleep(1950);
- System.out.println("Hint: It seems like a log in for Mr.Binz (MMDDYYYY)");
- Thread.sleep(1950);
- puzzle1g();
- } else if (object.equalsIgnoreCase("door")) {
- System.out.println("You walk over to the door and try the handle.");
- Thread.sleep(1950);
- System.out.println("It seems to be locked!");
- Thread.sleep(1950);
- System.out.print("You peek out the windows, into the hallway");
- dots();
- Thread.sleep(1950);
- System.out.println("It's too dark to notice anything.");
- Thread.sleep(1950);
- System.out.println("As you take a step back, you notice a protruding keyhole,");
- System.out.println("under the handle.");
- puzzle1();
- } else if (object.equalsIgnoreCase("tv")) {
- System.out.println("You walk over to the tv.");
- Thread.sleep(1950);
- System.out.print("It seems like an old box tv");
- dots();
- System.out.println("Several BUTTONs seem to be lining the bottom.");
- System.out.println("It seems be within a 'push' distance!");
- puzzle1e();
- }
- }
- }
- public static void puzzle1f() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- if(command.equalsIgnoreCase("yes")) {
- puzzle1b();
- }else if(command.equalsIgnoreCase("no")) {
- puzzle1c();
- }
- }
- public static void puzzle1g() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- System.out.println("Enter a Password: ");
- if(command.equals("Pw08191976")) {
- System.out.println("The computer opened");
- System.out.println("A title named 'Subjects' is open");
- System.out.println("They are logs describing the past escape room experiment.");
- System.out.println("One particularly pops out, ");
- System.out.println("There seems to be a note written on the side");
- System.out.println("Test Subject 7, displayed erratice behavior before he loses consciousness");
- System.out.println("He writes on the wall that 'the key is in the room'");
- System.out.println("Suddenly, the screen blacks out and the TV flickers back to life again");
- puzzle2();
- }else if(command.equalsIgnoreCase("Logout")) {
- puzzle1c();
- } else {
- System.out.println("Wrong password");
- System.out.println("Enter 'logout' to return to the room");
- puzzle1g();
- }
- }
- public static void puzzle2() throws InterruptedException{
- System.out.println("▬[Mr Binz]▬▬▬▬▬▬▬▬▬▬▬▬ ");
- System.out.println("Hello there, " + userName );
- Thread.sleep(750);
- System.out.println("It seems like you have opened my computer. ");
- Thread.sleep(750);
- System.out.println("You're never going to get out of this room!");
- Thread.sleep(750);
- System.out.println("HAHAHAHAHHAAHAAHHAHAHHAHAHHAHAHH");
- Thread.sleep(750);
- System.out.println("You will die like the subjects before you");
- Thread.sleep(750);
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ");
- System.out.println("The screen abruptly turns off and leaves the room in silence");
- puzzle2a();
- }
- public static void puzzle2a() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- System.out.println("You're back to the classroom.");
- System.out.println("Use 'look' to observe the SHELF, MUGS, COMPUTERS, and DOOR");
- if (command.equalsIgnoreCase("look")) {
- if (object.equalsIgnoreCase("shelf")) {
- System.out.print("There seems to be a few MUGS and BINDERS");
- dots();
- Thread.sleep(2500);
- System.out.println("You have already searched this room, ");
- Thread.sleep(1500);
- System.out.println("would you like to look through it again?");
- puzzle2a();
- } else if (object.equalsIgnoreCase("computers")) {
- System.out.print("You walk over to the computer and power it on");
- dots();
- Thread.sleep(1950);
- System.out.println("The screen is still black");
- Thread.sleep(1950);
- puzzle2a();
- } else if (object.equalsIgnoreCase("door")) {
- System.out.println("You walk over to the door and try the handle.");
- Thread.sleep(1950);
- System.out.println("It seems to be locked!");
- Thread.sleep(1950);
- System.out.print("You peek out the windows, into the hallway");
- dots();
- Thread.sleep(1950);
- System.out.println("It's too dark to notice anything.");
- Thread.sleep(1950);
- System.out.println("As you take a step back, you notice a protruding keyhole,");
- System.out.println("under the handle.");
- puzzle2a();
- } else if (object.equalsIgnoreCase("MUGS")) {
- System.out.println("You walk over to the tv.");
- Thread.sleep(1950);
- System.out.print("It seems like an old box tv");
- dots();
- System.out.println("Several BUTTONs seem to be lining the bottom.");
- System.out.println("It seems be within a 'push' distance!");
- puzzle2a();
- }
- }
- }
- public static void dots() throws InterruptedException{
- System.out.print(".");
- Thread.sleep(575);
- System.out.print(".");
- Thread.sleep(575);
- System.out.println(".");
- }
- }
- /*
- Locations:
- Shelf
- Computers
- Door
- Objects:
- Mugs
- Books
- Commands:
- Move
- Push
- Look
- Observe
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement