Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool CheckTreeRecursive(int64_t seed, JavaRnd rnd, int count, int treesFound, int chosenX, int chosenZ) {
- if(count == 10) {
- if(treesFound == 15) {
- return true;
- }
- return false;
- }
- int x = rnd.nextInt(16) + 8;
- int z = rnd.nextInt(16) + 8;
- int type = rnd.nextInt(3) == 0 ? 1 : 2;
- bool isvalid = false;
- if(seed == 43195804)
- printf("%d %d %d\n", x, z, type);
- if(chosenX == -1) {
- if(type == 1) return false;
- if(rnd.nextInt(4) != 2) return false; //l
- if(rnd.nextInt(2) != 1) return false; //i1
- if(rnd.nextInt(2) != 0) return false; //k1
- if(rnd.nextInt(2) != 1) return false; //k2
- if(rnd.nextInt(3) != 0) return false; //i4
- isvalid = true;
- chosenX = x;
- chosenZ = z;
- treesFound |= 1;
- return CheckTreeRecursive(seed, rnd, count + 1, treesFound, chosenX, chosenZ);
- }
- else {
- if(x == chosenX && z == chosenZ + 6 && (treesFound & 2) == 0) {
- if(type != 2) return false; //fuck that branch
- isvalid = true;
- treesFound |= 2;
- }
- else if(x == chosenX + 7 && z == chosenZ + 4 && (treesFound & 4) == 0) {
- if(type != 2) return false; //fuck that branch
- isvalid = true;
- treesFound |= 4;
- }
- else if(x == chosenX - 8 && z == chosenZ + 10 && (treesFound & 8) == 0) {
- if(type != 2) return false; //fuck that branch
- isvalid = true;
- treesFound |= 8;
- }
- }
- if(type == 1) {
- AssumeTaiga1Shenanigans(&rnd);
- return CheckTreeRecursive(seed, rnd, count + 1, treesFound, chosenX, chosenZ);
- }
- else {
- //assume it didn't spawn
- AssumeTaiga2Shenanigans(&rnd);
- bool ret1 = CheckTreeRecursive(seed, rnd, count + 1, treesFound, chosenX, chosenZ);
- //cut branches that we know didn't spawn
- if(!isvalid)
- return ret1;
- //coord above matches, assume it did spawn
- AssumeTaiga2ExtraShenanigans(&rnd);
- return ret1 || CheckTreeRecursive(seed, rnd, count + 1, treesFound, chosenX, chosenZ);
- }
- }
Add Comment
Please, Sign In to add comment