This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -c --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.2+10/e482c34c86bd4bf8b56c0b35558996b9/jdk-12.0.2_linux-x64_bin.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class C8Ex12CaptainCrunch3 { | |
public static char convert(String dict, int i, int n) { | |
if (n >= 0) { | |
if (i+n < 26) { | |
return dict.charAt(i+n); | |
} else { | |
return dict.charAt(i+n-26); | |
} | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class C8Ex12CaptainCrunch2 { | |
public static char convert(String dict, int j) { | |
if (j < 13) { | |
return dict.charAt(j+13); | |
} else { | |
return dict.charAt(j-13); | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class C8Ex12CaptainCrunch { | |
public static String decode(String s) { | |
String d = "abcdefghijklmnopqrstuvwboxyz"; //dict.indeboxOf(n) == 13 | |
String D = "ABCDEFGHIJKLMNOPQRSTUVWboxYZ"; | |
int i = 0; | |
int n = s.length(); | |
String box = ""; | |
while (i < n) { | |
if (s.charAt(i) == ' ') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class C8Ex12CaptainCrunch4 { | |
public static char convert(String dict, int i, int n) { | |
if (i+n > 0) { | |
return dict.charAt((i+n) % 26); | |
} else { | |
return dict.charAt(((i+n) % 26 + 26) % 26); | |
} | |
} | |