Skip to content

Instantly share code, notes, and snippets.

@NicolaiSoeborg
Created July 24, 2023 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NicolaiSoeborg/cc3085e7aade83c6095894729bce3516 to your computer and use it in GitHub Desktop.
Save NicolaiSoeborg/cc3085e7aade83c6095894729bce3516 to your computer and use it in GitHub Desktop.
antiyoy transfer progress
/*
Code to unlock all (176) levels:
* face3 (sad face)
* radioactive_ring
* triangle
* skull
* square
*/
import java.util.Arrays;
import java.util.Random;
class Antiyoy {
public String[] types = new String[] { "circle", "ring", "dotted_ring", "bomb", "studded_ring", "radioactive_ring",
"gear", "triangle", "square", "wheel", "dice1", "dice2", "dice4", "dice6", "hypno", "heart", "swords",
"skull", "star", "crown", "cherry", "face1", "face3" };
private Random random = new Random();
private long[] seeds = new long[] { 92017, 91697, 93511, 93571, 92749 };
public String[] encrypt(int lvl) {
String pceType;
String[] resultArr = new String[5];
for (int i = 0; i < resultArr.length; i++) {
this.random.setSeed(lvl * this.seeds[i]);
do {
int nextInt = this.random.nextInt(999999999);
String[] pceTypeArr2 = this.types;
pceType = pceTypeArr2[nextInt % pceTypeArr2.length];
} while (contains(resultArr, pceType));
resultArr[i] = pceType;
}
return resultArr;
}
private boolean contains(String[] pceTypeArr, String pceType) {
for (String pceType2 : pceTypeArr) {
if (pceType2 == pceType) {
return true;
}
}
return false;
}
public static void main(String[] args) {
var arr = new Antiyoy().encrypt(176);
for (String x : arr) {
System.out.println(x);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment