fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. object Flag extends App {
  9. var alpha = List[Int](150, 115, 160, 56, 153, 36, 222, 50, 172, 1, 3, 3, 7);
  10. var beta = List[Int](197, 56, 249, 21, 202, 103, 146, 115, 129, 55, 59, 48, 55);
  11.  
  12. print("> ");
  13. var input = scala.io.StdIn.readLine();
  14.  
  15. if (input.length != alpha.length) {
  16. println("Bad Input");
  17. System.exit(1);
  18. }
  19.  
  20. for (i <- 0 until alpha.length) {
  21. var c:Int = Character.codePointAt(input, i);
  22. if ((c ^ alpha(i)) != beta(i)) {
  23. println("Wrong flag!");
  24. System.exit(1);
  25. }
  26. }
  27.  
  28. println("WOOT! You Got It!")
  29. }
  30.  
  31. Flag.main(args);
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:8: error: class, interface, or enum expected
object Flag extends App {
^
Main.java:10: error: class, interface, or enum expected
  var beta = List[Int](197, 56, 249, 21, 202, 103, 146, 115, 129, 55, 59, 48, 55);
  ^
Main.java:12: error: class, interface, or enum expected
  print("> ");
  ^
Main.java:13: error: class, interface, or enum expected
  var input = scala.io.StdIn.readLine();
  ^
Main.java:15: error: class, interface, or enum expected
  if (input.length != alpha.length) {
  ^
Main.java:17: error: class, interface, or enum expected
    System.exit(1);
    ^
Main.java:18: error: class, interface, or enum expected
  }
  ^
Main.java:22: error: class, interface, or enum expected
    if ((c ^ alpha(i)) != beta(i)) {
    ^
Main.java:24: error: class, interface, or enum expected
      System.exit(1);
      ^
Main.java:25: error: class, interface, or enum expected
    }
    ^
10 errors
stdout
Standard output is empty