Advertisement
Guest User

Seed finding

a guest
Dec 24th, 2017
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. public class perfect {
  2. static int f(int x) {
  3. x ^= x << 13;
  4. x ^= x >> 17;
  5. x ^= x << 15;
  6. return x;
  7. }
  8. static int rem1(int x){
  9. x = Math.abs(x);
  10. x = x%10000;
  11. if(x > 9500) {
  12. return 2;
  13. }else if (x>7500) {
  14. return 1;
  15. }else{
  16. return 0;
  17. }
  18. }
  19. static int rem2(int r,int y){
  20. y = Math.abs(y);
  21. if(r==2){
  22. return y%6;
  23. }else if (r==1){
  24. return y%16;
  25. }else {
  26. return y%23;
  27. }
  28. }
  29.  
  30. public static void main(String[] args){
  31. int[][] array = {{0,3},{0,5},{0,0},{0,13},{0,2},{0,5},{0,18},{1,2},{0,22},{1,1}};
  32. for (int i=-2147483647;i<2147483647;i++){
  33. int seed = i;
  34. int j = 0;
  35. boolean Running = true;
  36. while(j<10 && Running){
  37. int rarity = rem1(seed);
  38. seed = f(seed);
  39. int slot = rem2(rarity,seed);
  40. if (rarity != array[j][0]) {
  41. Running = false;
  42. }
  43. if (slot != array[j][1]) {
  44. Running = false;
  45. }
  46. seed = f(seed);
  47. if (j==9){
  48. System.out.println(i);
  49. System.out.println("This is it");
  50. }
  51. j ++;
  52. }
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement