嘗試用Java實(shí)現(xiàn) Still Alive (傳送門1 ED)

public class GLaDOS_StillAlive {
???
??private static void typing01(String line){
????//Prints each character of the string one by one every 0.066 seconds
??????try{
???????for (int cnt = 0; cnt < line.length(); cnt++){
????????System.out.print(line.charAt(cnt));
????????Thread.sleep(66);
????????}
??????}catch(InterruptedException ie) {}
????System.out.println();
????System.out.println();
??}
???
??private static void typing02(String line){
????//Prints each character of the string one by one every 0.15 seconds
??????try{
???????for (int cnt = 0; cnt < line.length(); cnt++){
????????System.out.print(line.charAt(cnt));
????????Thread.sleep(150);
????????}
??????}catch(InterruptedException ie) {}
????System.out.println();
????System.out.println();
??}
??private static void typing03(String line){
????//Prints each character of the string one by one every 0.02 seconds
??????try{
???????for (int cnt = 0; cnt < line.length(); cnt++){
????????System.out.print(line.charAt(cnt));
????????Thread.sleep(20);
????????}
??????}catch(InterruptedException ie) {}
????System.out.println();
????System.out.println();
??}
???
??private static void pause(){
????//Pauses for 1.5 seconds
??????try{
????????Thread.sleep(1500);
??????}catch(InterruptedException ie) {}
??}
???
??public static void main(String[] args) {
?????
????????System.out.println();
?????????
????????String line01 = "Forms FORM-29827281-12";
String line02 = "Test Assessment Report";
String line03 = "This was a triumph.";
String line04 = "I'm making a note here:";
String line05 = "HUGE SUCCESS";
String line06 = "It's hard to overstate";
String line07 = "my satisfaction.";
String line08 = "Aperture Science:";
String line09 = "We do what we must";
String line10 = "because we can";
String line11 = "For the good of all of us.";
String line12 = "Except the ones who are dead.";
String line13 = "But there's no sense crying";
String line14 = "over every mistake.";
String line15 = "You just keep on trying";
String line16 = "till you run out of cake.";
String line17 = "And the science gets done.";
String line18 = "And you make a neat gun.";
String line19 = "For the people who are";
String line20 = "still alive.";
String line21 = "Forms FORM-55551-5:";
String line22 = "Personnel File Addendum:";
String line23 = "Dear <<Subject Name Here>>,";
String line24 = "I'm not even angry.";
String line25 = "I'm being so sincere right now.";
String line26 = "Even though you broke my heart.";
String line27 = "And killed me";
String line28 = "And tore me to pieces.";
String line29 = "And threw every piece into a fire.";
String line30 = "As they burned it hurt because";
String line31 = "I was so happy for you!";
String line32 = "Now these points of data";
String line33 = "make a beautiful line.";
String line34 = "And we're out of beta.";
String line35 = "And we're releasing on time";
String line36 = "So I'm GLaD. I got burned.";
String line37 = "Think of all the things we learned";
String line38 = "for the people who are";
String line39 = "still alive.";
String line40 = "Forms FORM-55551-6:";
String line41 = "Personal File Addendum Addendum:";
String line42 = "One last thing:";
String line43 = "So ahead and leave me.";
String line44 = "I think I prefer to stay inside.";
String line45 = "Maybe you'll find someone else";
String line46 = "to help you.";
String line47 = "Maybe Black Mesa...";
String line48 = "THAT WAS A JOKE. HA HA. FAT CHANCE.";
String line49 = "Anyway, this cake is great.";
String line50 = "It's so delicious and moist";
String line51 = "Look at me still talking";
String line52 = "when there's Science to do.";
String line53 = "When I look up there,";
String line54 = "it makes me GLaD I'm not you.";
String line55 = "I've experiments to run.";
String line56 = "There is research to be done.";
String line57 = "On the people who are";
String line58 = "still alive.";
String line59 = "PS: And believe me I am";
String line60 = "still alive.";
String line61 = "PPS: I'm doing Science and I'm";
String line62 = "still alive.";
String line63 = "PPPS: I feel FANTASTIC and I'm";
String line64 = "still alive.";
String line65 = "FINAL THOUGHT:";
String line66 = "While you're dying I'll be";
String line67 = "still alive.";
String line68 = "FINAL THOUGHT PS:";
String line69 = "And when you're dead I will be";
String line70 = "still alive.";
String line71 = "STILL ALIVE";
String line72 = "Still alive.";
?????????
?????????
????????typing03(line01);
????????typing03(line02);
????????System.out.println();
????????pause();
????????typing01(line03);
????????pause();
????????typing01(line04);
????????typing02(line05);
????????typing02(line06);
????????typing01(line07);
????????pause();
????????typing02(line08);
????????ApertureLogo aL = new ApertureLogo();
????????aL.apertureLogo();
????????typing01(line09);
????????typing02(line10);
????????typing02(line11);
????????typing01(line12);
????????pause();
????????System.out.println();
????????typing01(line13);
????????typing01(line14);
????????typing01(line15);
????????typing01(line16);
????????typing01(line17);
????????typing01(line18);
????????typing01(line19);
????????typing02(line20);
????????System.out.println();
????????pause();
????????typing03(line21);
????????typing03(line22);
????????System.out.println();
????????pause();
????????typing03(line23);
????????System.out.println();
????????typing01(line24);
????????typing02(line25);
????????typing02(line26);
????????Heart heart = new Heart();
????????heart.showHeart();
????????typing02(line27);
????????typing01(line28);
????????typing02(line29);
????????typing02(line30);
????????typing01(line31);
????????pause();
????????typing01(line32);
????????typing01(line33);
????????typing01(line34);
????????typing01(line35);
????????typing01(line36);
????????typing01(line37);
????????typing01(line38);
????????typing01(line39);
????????System.out.println();
????????pause();
????????typing03(line40);
????????typing03(line41);
????????System.out.println();
????????pause();
????????typing03(line42);
????????System.out.println();
????????typing02(line43);
????????typing02(line44);
????????typing02(line45);
????????typing01(line46);
????????pause();
????????typing03(line47);
????????Blackmesa bl = new Blackmesa();
????????bl.blackmesaLogo();
????????pause();
????????typing02(line48);
????????typing02(line49);
????????typing01(line50);
????????pause();
????????typing01(line51);
????????typing01(line52);
????????typing02(line53);
????????typing01(line54);
????????typing01(line55);
????????typing01(line56);
????????typing01(line57);
????????typing02(line58);
????????System.out.println();
????????typing01(line59);
????????typing01(line60);
????????System.out.println();
????????typing01(line61);
????????typing01(line62);
????????System.out.println();
????????typing01(line63);
????????typing02(line64);
????????System.out.println();
????????typing03(line65);
????????typing01(line66);
????????typing02(line67);
????????System.out.println();
????????typing03(line68);
????????typing01(line69);
????????typing02(line70);
????????pause();
????????System.out.println();
????????typing02(line71);
????????pause();
????????System.out.println();
????????typing01(line72);
?????
??}
???
}
public class ApertureLogo {
??public void apertureLogo(){
????System.out.println("?????????.,-;;//;\\=,.\n" +
????????"????????. 1H@@@MM@M#H/ ,+;,\n" +
????????"??????,/X+ +M@@M@MM% ,-%HMMM@X/,?\n" +
????????"?????-+@MM; SM@@MH+- ;XMMMM@MMMM@+-\n" +
????????"?????,@M@@M- XM@X;. -+XXXXXHHH@M@M.--.??\n" +
????????"????,%MM@@MH ,@%=??????..--=-=;=,.\n" +
????????"????+@#@@@MX .,???????-%HXSS%%%+;\n" +
????????"????=; .@M@M$?????????.;@MMMM@MM;\n" +
????????"????X@= -#MM/??????????.+MM@@@M#;\n" +
????????"???,@M@H; ;@1???????????. =X#@@@@\n" +
????????"???,@@@MMX, .??????????/H- ;@M@M=\n" +
????????"???.H@@@@M@+,??????????%MM+. %#$.\n" +
????????"????/MMMM@MMH\\.?????????XM@MH; =;\n" +
????????"????/%+%SXHH@#=???????, .H@@@@MX,\n" +
????????"?????.,,.,,..,,,??????-%H ,@@@@@MX,?\n" +
????????"?????%MM@@@HHHXM++;;-- .;SMMX =M@@MM%.\n" +
????????"??????=XMCAMAMAGUEY ,-+HMM@M+ /MMMX=\n" +
????????"???????=%@M@M#@S .=#@MM@@@M; %M%=\n" +
????????"????????,;+#+- /H#MMMMMMM@= =,\n" +
????????"?????????--. =++%%%%+/;-.");
??}
}
public class Blackmesa {
??public void blackmesaLogo(){
????System.out.println("?????.-;+$XHHHHHHX$+;-.\n" +
????????"????,;X@@X%/;=----=:/%X@@X/,\n" +
????????"???=$@@%=.???????.=+H@X:\n" +
????????"??-XMX:???????????=XMX=\n" +
????????"??/@@:?????????????=H@+\n" +
????????"?%@X,??????????????.$@$\n" +
????????" +@X.????????????????$@%\n" +
????????"-@@,????????????????.@@=\n" +
????????"%@%?????????????????+@$\n" +
????????"H@:?????????????????:@H\n" +
????????"H@:?????????????????=@H\n" +
????????"%@%?????;@M@@@@@@@@@@@@@@@@@H-??+@$\n" +
????????"=@@,????:@@@@@@@@@@@@@@@@@@@@@= .@@:\n" +
????????" +@X????:@@@@@@@@@@@@@@@M@@@@@@:%@%\n" +
????????"?$@$,???;@@@@@@@@@@@@@@@@@M@@@@@@$.\n" +
????????"??+@@HHHHHHH@@@@@@@@@@@@@@@@@@@@@@@+\n" +
????????"??=X@@@@@@@@@@@@@@@@@@@@@@@@@@@@X=\n" +
????????"???:$@@@@@@@@@@@@@@@@@@@M@@@@$:\n" +
????????"????,;$@@@@@@@@@@@@@@@@@@X/-\n" +
????????"??????.-;+$XXHHHHHX$+;-.\n");
??}
}
public class Heart {
??public void showHeart(){
????System.out.println("?????????????.,---.\n" +
????????"????????????,/XM#MMMX;,\n" +
????????"???????????-%##########M%,\n" +
????????"???????????-@######%?$###@=\n" +
????????"???.,--,?????-H#######$??$###M:\n" +
????????"??,;$M###MMX;???.;##########$;HM###X=\n" +
????????" ,/@##########H=???;################+\n" +
????????"-+#############M/,???%##############+\n" +
????????"%M###############=???/##############:\n" +
????????"H################???.M#############;.\n" +
????????"@###############M???,@###########M:.\n" +
????????"X################,???-$=X#######@:\n" +
????????"/@##################%-???+######$-\n" +
????????".;##################X???.X#####+,\n" +
????????" .;H################/???-X####+.\n" +
????????"??,;X##############,????.MM/\n" +
????????"???,:+$H@M#######M#$-??.$$=\n" +
????????"??????.,-=;+$@###X:??;/=.\n" +
????????"?????????.,/X$;??.::,\n" +
????????"???????????.,??..\n");
??}
}