package kaptainwutax.seedcracker.cracker; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; public class PillarData { private List heights; public PillarData(List heights) { this.heights = heights; } public List getPillarSeeds() { List result = new ArrayList<>(); for(int pillarSeed = 0; pillarSeed < (1 << 16); pillarSeed++) { List h = this.getPillarHeights(pillarSeed); if(h.equals(heights))result.add(pillarSeed); } return result; } public List getPillarHeights(int spikeSeed) { List indices = new ArrayList<>(); for (int i = 0; i < 10; i++) { indices.add(i); } Collections.shuffle(indices, new Random(spikeSeed)); List heights = new ArrayList<>(); for (Integer index: indices) { heights.add(76 + index * 3); } return heights; } }