mirror of
https://github.com/TheEntropyShard/JDarkroom.git
synced 2025-02-23 21:01:24 +03:00
Fully fixed decoding, added Test.java and Shell build script
This commit is contained in:
parent
c857d52f96
commit
8994bcf209
8 changed files with 305 additions and 88 deletions
23
test/Test.java
Normal file
23
test/Test.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
import me.theentropyshard.jdarkroom.Decoder;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
Scanner scanner = new Scanner(Objects.requireNonNull(Test.class.getResourceAsStream("/test_data.txt")));
|
||||
for(int i = 1; scanner.hasNextLine(); i++) {
|
||||
String code = scanner.nextLine();
|
||||
if(code.length() != 16) {
|
||||
System.err.println("Found illegal test code in test_data.txt: " + code + ", line=" + i + ", length=" + code.length());
|
||||
continue;
|
||||
}
|
||||
String decoded = Decoder.decodeInternetCode(code);
|
||||
System.out.println("Successfully decoded: " + code + " into " + decoded);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue