fork download
  1. class Jaskier
  2. {
  3. public static void main (String[] args) throws java.lang.Exception
  4. {
  5. char Action = ' ';
  6.  
  7. while (Action != 'e') {
  8. System.out.println("[T]oss a coin to your witcher or [E]xit?");
  9. Action = (char) System.in.read();
  10.  
  11. switch(Action) {
  12. case 't':
  13. case 'T':
  14. if (new java.util.Date().getTime() % 2 == 0) {
  15. System.out.println("Head!");
  16. } else {
  17. System.out.println("Tails!");
  18. }
  19. break;
  20. case 'e': {
  21. System.out.println("Okay.");
  22. }
  23. }
  24.  
  25. System.out.println();
  26. }
  27. }
  28. }
Success #stdin #stdout 0.08s 32548KB
stdin
tTte
stdout
[T]oss a coin to your witcher or [E]xit?
Head!

[T]oss a coin to your witcher or [E]xit?
Tails!

[T]oss a coin to your witcher or [E]xit?
Tails!

[T]oss a coin to your witcher or [E]xit?
Okay.