Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.15 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class EscapeRoom{
  3. public static String password = "Pw08191976";
  4. public static boolean on = false;
  5. public static String userName = "";
  6. public static void main(String[] args) throws InterruptedException{
  7. Scanner console = new Scanner(System.in);
  8. //intro();
  9. userName = getUsername();
  10. description();
  11. puzzle0();
  12. String input = console.nextLine();
  13.  
  14. while(!input.equalsIgnoreCase("Quit")){
  15. input = console.nextLine();
  16. }
  17. }
  18. public static void intro() throws InterruptedException{
  19. System.out.println("As you gradually open your eyes, you realize ");
  20. Thread.sleep(2300);
  21. System.out.println("you are in Mr.Binz' AP Java classroom.");
  22. Thread.sleep(2300);
  23. System.out.println("While rubbing the weariness from your eyes, ");
  24. Thread.sleep(2300);
  25. System.out.println("you notice that it is pitch black outside.");
  26. Thread.sleep(2300);
  27. System.out.println("You get up slowly and casually walk to the exit ");
  28. Thread.sleep(2300);
  29. System.out.println("only to grasp that it's locked.");
  30. Thread.sleep(2300);
  31. System.out.println("");
  32. System.out.println("╔══════════════════════╗");
  33. System.out.println("\tEscape Room");
  34. System.out.println("\tJuan HeeSoo");
  35. System.out.println("╚══════════════════════╝");
  36. System.out.println("");
  37. }
  38. public static String getUsername() throws InterruptedException{
  39. Scanner console = new Scanner(System.in);
  40. Thread.sleep(750);
  41. System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬");
  42. Thread.sleep(750);
  43. System.out.println("Enter a username: ");
  44. String name = console.next();
  45. Thread.sleep(750);
  46. System.out.println("Welcome to the Escape Room");
  47. System.out.println("\t" + name);
  48. Thread.sleep(500);
  49. System.out.println("");
  50. Thread.sleep(500);
  51. System.out.println("Enter 'quit' to quit");
  52. Thread.sleep(750);
  53. System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬");
  54. Thread.sleep(750);
  55. System.out.println("");
  56. return name;
  57. }
  58. public static void description() throws InterruptedException{
  59. Thread.sleep(950);
  60. System.out.println("Suddenly the TV flickers to life!");
  61. Thread.sleep(1900);
  62. System.out.print("Behind a wall of static, you notice a figure");
  63. dots();
  64. Thread.sleep(2350);
  65. System.out.println("▬[Mr Binz]▬▬▬▬▬▬▬▬▬▬▬▬ ");
  66. System.out.println("Hello there, " + userName );
  67. Thread.sleep(750);
  68. System.out.println("It seems like you have awoken. ");
  69. Thread.sleep(750);
  70. System.out.println("You're currently in room 334 taking part in my little expirement.");
  71. Thread.sleep(750);
  72. System.out.println(" To get out of my room, ");
  73. Thread.sleep(750);
  74. System.out.println("you will need to solve a series of puzzles.");
  75. Thread.sleep(750);
  76. System.out.println("Good luck, player");
  77. System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ");
  78. Thread.sleep(700);
  79. System.out.println("Suddenly, the TV blacks out!");
  80. Thread.sleep(700);
  81. System.out.println("Hint: Use 'observe' to look around");
  82. }
  83. public static void puzzle0() throws InterruptedException{
  84. Scanner console = new Scanner(System.in);
  85. String command = console.next();
  86. if (command.equalsIgnoreCase("observe")) {
  87. System.out.println("It seems like the same computer room you come");
  88. Thread.sleep(2250);
  89. System.out.println("to everyday. In the vicinity you see the SHELF,");
  90. Thread.sleep(2250);
  91. System.out.print("COMPUTERS, DOOR, and a TV");
  92. dots();
  93. System.out.println("Why don't you 'look' around?(Hint:look object)");
  94. puzzle1();
  95. } else if(!command.equalsIgnoreCase("observe")) {
  96. System.out.println("Unknown command registered!");
  97. System.out.println("Hint: Use 'observe' to look around");
  98. puzzle0();
  99. }
  100. }
  101. public static void puzzle1() throws InterruptedException{
  102. Scanner console = new Scanner(System.in);
  103. String command = console.next();
  104. String object = console.next();
  105. if (command.equalsIgnoreCase("look")) {
  106. if (object.equalsIgnoreCase("shelf")) {
  107. System.out.print("There seems to be a few MUGS and BINDERS");
  108. dots();
  109. Thread.sleep(2500);
  110. System.out.println("Suddenly, you feel a breeze coming from behind the shelf!");
  111. Thread.sleep(800);
  112. System.out.println("What will you do?");
  113. puzzle1a();
  114. } else if (object.equalsIgnoreCase("computers")) {
  115. System.out.print("You walk over to the computer and power it on");
  116. dots();
  117. Thread.sleep(1950);
  118. System.out.println("It looks like its locked!");
  119. Thread.sleep(1950);
  120. System.out.println("It needs a password");
  121. puzzle1();
  122. } else if (object.equalsIgnoreCase("door")) {
  123. System.out.println("You walk over to the door and try the handle.");
  124. Thread.sleep(1950);
  125. System.out.println("It seems to be locked!");
  126. Thread.sleep(1950);
  127. System.out.print("You peek out the windows, into the hallway");
  128. dots();
  129. Thread.sleep(1950);
  130. System.out.println("It's too dark to notice anything.");
  131. Thread.sleep(1950);
  132. System.out.println("As you take a step back, you notice a protruding keyhole,");
  133. System.out.println("under the handle.");
  134. puzzle1();
  135. } else if (object.equalsIgnoreCase("tv")) {
  136. System.out.println("You walk over to the tv.");
  137. Thread.sleep(1950);
  138. System.out.print("It seems like an old box tv");
  139. dots();
  140. System.out.println("Several BUTTONs seem to be lining the bottom.");
  141. System.out.println("It seems be within a 'push' distance!");
  142. puzzle1e();
  143. }
  144. }
  145. }
  146. public static void puzzle1e() throws InterruptedException{
  147. Scanner console = new Scanner(System.in);
  148. String command = console.next();
  149. String object = console.next();
  150. if (command.equalsIgnoreCase("push")) {
  151. if (object.equalsIgnoreCase("button")) {
  152. System.out.println("You push the power button on the TV.");
  153. Thread.sleep(1950);
  154. System.out.println("Nothing seems to happen.");
  155. Thread.sleep(1950);
  156. System.out.println("You try the other buttons.");
  157. Thread.sleep(1950);
  158. System.out.print("It seems to be dead");
  159. dots();
  160. puzzle1();
  161. }
  162. }
  163. }
  164. public static void puzzle1a() throws InterruptedException{
  165. System.out.println("Hint: There seems to be something behind the SHELF!");
  166. Thread.sleep(2250);
  167. System.out.print(" Maybe you can 'push' it out of the way");
  168. dots();
  169. Scanner console = new Scanner(System.in);
  170. String command = console.next();
  171. String object = console.next();
  172. if (command.equalsIgnoreCase("push")) {
  173. System.out.println("You push the shelf to find a dark, dusty room");
  174. Thread.sleep(2250);
  175. System.out.println("Within it, a lone table stands");
  176. Thread.sleep(2250);
  177. System.out.println("You see a thick BOOK sitting on top of it");
  178. puzzle1b();
  179. } //else if(commad.equalsIgnoreCase("look")) {
  180. //}
  181. else if(!command.equalsIgnoreCase("push")) {
  182. System.out.println("Unknown command registered!");
  183. Thread.sleep(2250);
  184. System.out.println("Hint: There seems to be something behind the shelf!");
  185. Thread.sleep(2250);
  186. System.out.print(" Maybe you can push it out of the way");
  187. dots();
  188. puzzle0();
  189. }
  190. }
  191. public static void puzzle1b() throws InterruptedException{
  192.  
  193. System.out.println("You lift the heavy cover of the book and wipe off the coat of dust.");
  194. Thread.sleep(1950);
  195. System.out.println("On the cover it reads 'AP Java Class of 11111001011'"); //1995
  196. Thread.sleep(1950);
  197. System.out.println("As you begin to flip through the pages, you see the names and pictures of several students,");
  198. Thread.sleep(1950);
  199. System.out.println("who you don't recognize. Suddenly, a note falls to the ground.");
  200. Thread.sleep(1950);
  201. System.out.println("Dear Nathan, 19th Birthday. Congrats on your graduation."); //happy birthday note. August 19 1976 from sidechar1 name later
  202. Thread.sleep(1950);
  203. System.out.println("Hopefully you had a good 2 months off of school. I'm sending this on the 14th because");
  204. Thread.sleep(1950);
  205. System.out.println("it usually takes around 5 days for my mail to get to you. Hopefully you get this on your");
  206. Thread.sleep(1950);
  207. System.out.println("birthday. From sidechar1.");
  208. dots();
  209. puzzle1c();
  210. }
  211. public static void puzzle1c() throws InterruptedException{
  212. Scanner console = new Scanner(System.in);
  213. String command = console.next();
  214. String object = console.next();
  215. if (command.equalsIgnoreCase("look")) {
  216. if (object.equalsIgnoreCase("shelf")) {
  217. System.out.print("There seems to be a few MUGS and BINDERS");
  218. dots();
  219. Thread.sleep(2500);
  220. System.out.println("You have already searched this room, ");
  221. Thread.sleep(1500);
  222. System.out.println("would you like to look through it again?");
  223. puzzle1f();
  224. } else if (object.equalsIgnoreCase("computers")) {
  225. System.out.print("You walk over to the computer and power it on");
  226. dots();
  227. Thread.sleep(1950);
  228. System.out.println("On the bottom right corner a notification pops up");
  229. Thread.sleep(1950);
  230. System.out.println("The screen prompts for a password");
  231. Thread.sleep(1950);
  232. System.out.println("Hint: It seems like a log in for Mr.Binz (MMDDYYYY)");
  233. Thread.sleep(1950);
  234. puzzle1g();
  235. } else if (object.equalsIgnoreCase("door")) {
  236. System.out.println("You walk over to the door and try the handle.");
  237. Thread.sleep(1950);
  238. System.out.println("It seems to be locked!");
  239. Thread.sleep(1950);
  240. System.out.print("You peek out the windows, into the hallway");
  241. dots();
  242. Thread.sleep(1950);
  243. System.out.println("It's too dark to notice anything.");
  244. Thread.sleep(1950);
  245. System.out.println("As you take a step back, you notice a protruding keyhole,");
  246. System.out.println("under the handle.");
  247. puzzle1();
  248. } else if (object.equalsIgnoreCase("tv")) {
  249. System.out.println("You walk over to the tv.");
  250. Thread.sleep(1950);
  251. System.out.print("It seems like an old box tv");
  252. dots();
  253. System.out.println("Several BUTTONs seem to be lining the bottom.");
  254. System.out.println("It seems be within a 'push' distance!");
  255. puzzle1e();
  256. }
  257. }
  258. }
  259. public static void puzzle1f() throws InterruptedException{
  260. Scanner console = new Scanner(System.in);
  261. String command = console.next();
  262. if(command.equalsIgnoreCase("yes")) {
  263. puzzle1b();
  264. }else if(command.equalsIgnoreCase("no")) {
  265. puzzle1c();
  266. }
  267. }
  268. public static void puzzle1g() throws InterruptedException{
  269. Scanner console = new Scanner(System.in);
  270. String command = console.next();
  271.  
  272. System.out.println("Enter a Password: ");
  273. if(command.equals("Pw08191976")) {
  274. System.out.println("The computer opened");
  275. System.out.println("A title named 'Subjects' is open");
  276. System.out.println("They are logs describing the past escape room experiment.");
  277. System.out.println("One particularly pops out, ");
  278. System.out.println("There seems to be a note written on the side");
  279. System.out.println("Test Subject 7, displayed erratice behavior before he loses consciousness");
  280. System.out.println("He writes on the wall that 'the key is in the room'");
  281. System.out.println("Suddenly, the screen blacks out and the TV flickers back to life again");
  282. puzzle2();
  283. }else if(command.equalsIgnoreCase("Logout")) {
  284. puzzle1c();
  285. } else {
  286. System.out.println("Wrong password");
  287. System.out.println("Enter 'logout' to return to the room");
  288. puzzle1g();
  289. }
  290. }
  291. public static void puzzle2() throws InterruptedException{
  292. System.out.println("▬[Mr Binz]▬▬▬▬▬▬▬▬▬▬▬▬ ");
  293. System.out.println("Hello there, " + userName );
  294. Thread.sleep(750);
  295. System.out.println("It seems like you have opened my computer. ");
  296. Thread.sleep(750);
  297. System.out.println("You're never going to get out of this room!");
  298. Thread.sleep(750);
  299. System.out.println("HAHAHAHAHHAAHAAHHAHAHHAHAHHAHAHH");
  300. Thread.sleep(750);
  301. System.out.println("You will die like the subjects before you");
  302. Thread.sleep(750);
  303.  
  304. System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ");
  305. System.out.println("The screen abruptly turns off and leaves the room in silence");
  306. puzzle2a();
  307. }
  308. public static void puzzle2a() throws InterruptedException{
  309. Scanner console = new Scanner(System.in);
  310. String command = console.next();
  311. String object = console.next();
  312. System.out.println("You're back to the classroom.");
  313. System.out.println("Use 'look' to observe the SHELF, MUGS, COMPUTERS, and DOOR");
  314. if (command.equalsIgnoreCase("look")) {
  315. if (object.equalsIgnoreCase("shelf")) {
  316. System.out.print("There seems to be a few MUGS and BINDERS");
  317. dots();
  318. Thread.sleep(2500);
  319. System.out.println("You have already searched this room, ");
  320. Thread.sleep(1500);
  321. System.out.println("would you like to look through it again?");
  322. puzzle2a();
  323. } else if (object.equalsIgnoreCase("computers")) {
  324. System.out.print("You walk over to the computer and power it on");
  325. dots();
  326. Thread.sleep(1950);
  327. System.out.println("The screen is still black");
  328. Thread.sleep(1950);
  329. puzzle2a();
  330. } else if (object.equalsIgnoreCase("door")) {
  331. System.out.println("You walk over to the door and try the handle.");
  332. Thread.sleep(1950);
  333. System.out.println("It seems to be locked!");
  334. Thread.sleep(1950);
  335. System.out.print("You peek out the windows, into the hallway");
  336. dots();
  337. Thread.sleep(1950);
  338. System.out.println("It's too dark to notice anything.");
  339. Thread.sleep(1950);
  340. System.out.println("As you take a step back, you notice a protruding keyhole,");
  341. System.out.println("under the handle.");
  342. puzzle2a();
  343. } else if (object.equalsIgnoreCase("MUGS")) {
  344. System.out.println("You walk over to the tv.");
  345. Thread.sleep(1950);
  346. System.out.print("It seems like an old box tv");
  347. dots();
  348. System.out.println("Several BUTTONs seem to be lining the bottom.");
  349. System.out.println("It seems be within a 'push' distance!");
  350. puzzle2a();
  351. }
  352. }
  353. }
  354. public static void dots() throws InterruptedException{
  355. System.out.print(".");
  356. Thread.sleep(575);
  357. System.out.print(".");
  358. Thread.sleep(575);
  359. System.out.println(".");
  360. }
  361. }
  362. /*
  363. Locations:
  364. Shelf
  365. Computers
  366. Door
  367.  
  368. Objects:
  369. Mugs
  370. Books
  371.  
  372. Commands:
  373. Move
  374. Push
  375. Look
  376. Observe
  377.  
  378.  
  379. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement