import java.io.*;
classMain {
publicstaticvoidmain(String[] args) throws IOException {
System.out.println("*******************************");
System.out.println("*******Library ADVENTRUE*******");
System.out.println("*******************************");
String password = "12345";
String text = "";
String legacy = "";
Boolean getBook = false;
Boolean doorOpened = false;
Boolean one = false, two = false, three = false, four = false, five = false;
// 使用 System.in 创建 BufferedReader
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Do you want to enter the library?");
System.out.println("Enter \'yes\' if you want, \'no\' if you do not.");
// 读取字符do {
legacy = text;
text = br.readLine();
if (text.equals("yes")) {
System.out.println("Entered library");
System.out.println("Do you want to read the books? \'y\' for yes, \'n\' for no");
} elseif (text.equals("no")) {
System.out.println("You left the library, game OVER");
break;
} elseif (one && two && three && four && five) {
System.out.println("Magic DOOR opened.");
System.out.println("Please enter the password:");
doorOpened = true;
one = false;
} elseif (doorOpened) {
if (text.equals(password)) {
System.out.println("You completed the library god's puzzle, YOU WIN!!!");
break;
} else {
System.out.println("password incorrect, try again");
}
} elseif (text.equals("y") && legacy.equals("yes")) {
getBook = true;
System.out.println("Please pick from Book 1-5: ");
} elseif (text.equals("n") && getBook) {
System.out.println("You reject the library god, game OVER");
break;
} elseif (text.equals("1") && getBook) {
System.out.println("<-----You are now reading book 1----->");
System.out.println("Description:");
System.out.println("hi");
one = true;
} elseif (text.equals("2") && getBook) {
System.out.println("<-----You are now reading book 2----->");
System.out.println("Description:");
System.out.println("hello");
two = true;
} elseif (text.equals("3") && getBook) {
System.out.println("<-----You are now reading book 3----->");
System.out.println("Description:");
System.out.println("bonjour");
three = true;
} elseif (text.equals("4") && getBook) {
System.out.println("<-----You are now reading book 4----->");
System.out.println("Description:");
System.out.println("salute");
four = true;
} elseif (text.equals("5") && getBook) {
System.out.println("<-----You are now reading book 5----->");
System.out.println("Description:");
System.out.println("hej");
five = true;
} elseif (one && two && three && four && five) {
System.out.println("Magic DOOR opened.");
System.out.println("Please enter the password:");
doorOpened = true;
one = false;
}
} while (!text.equals("end"));
}
}