fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.io.*;
  4. import java.util.*;
  5.  
  6. /* The class name doesn't have to be Main, as long as the class is not public. */
  7. public class Main {
  8.  
  9. public static void main(String[] args) {
  10.  
  11. String seed;
  12. long iSeed;
  13.  
  14. System.out.flush();
  15. try {
  16. seed = stdin.readLine();
  17. }catch(java.io.IOException exp){ exp.printStackTrace(); seed="404";}
  18.  
  19. Random c = new Random();
  20.  
  21. try {
  22. iSeed = Long.parseLong(seed);
  23. }
  24. catch(NumberFormatException nFE) {
  25. iSeed = seed.hashCode();
  26. }
  27.  
  28. c.setSeed(iSeed);
  29. double d = c.nextDouble() * 3.1415926535897931D * 2D;
  30. for(int l = 0; l < 3; l++)
  31. {
  32. double d1 = (1.25D + c.nextDouble()) * 32D;
  33. int j1 = (int)Math.round(Math.cos(d) * d1);
  34. int k1 = (int)Math.round(Math.sin(d) * d1);
  35.  
  36. int j2 = (j1 << 4) + 8;
  37. int k2 = (k1 << 4) + 8;
  38.  
  39. System.out.println(l + ": " + j2 + " " + k2);
  40.  
  41. d += 6.2831853071795862D / 3D;
  42. }
  43. }
  44. }
Success #stdin #stdout 0.02s 246656KB
stdin
1421121651366220884
stdout
0: 1128 -216
1: -296 904
2: -680 -792