Skip to content

Instantly share code, notes, and snippets.

@Treeki
Created April 16, 2020 04:30
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Treeki/7297a459bb104ae5401c1ce5f7e205a6 to your computer and use it in GitHub Desktop.
Save Treeki/7297a459bb104ae5401c1ce5f7e205a6 to your computer and use it in GitHub Desktop.
ACNH flower breeding stuff
/* WARNING: Type propagation algorithm not settling */
uint ProduceNewFlowerGenes(ulonglong geneSetA,uint geneSetB)
{
int iVar1;
uint outputGene3;
uint outputGene2;
ulonglong geneSetA_;
uint outputGene0;
uint outputGene1;
ulonglong inputGeneA1Raw;
byte inputGeneB2;
ulonglong inputGeneB2Raw;
byte inputGeneA2;
ulonglong inputGeneA2Raw;
byte inputGeneB1;
byte inputGeneB3;
ulonglong inputGeneB3Raw;
byte inputGeneA3;
ulonglong inputGeneA3Raw;
byte inputGeneA1;
byte inputGeneB0;
undefined8 inputGeneB1Raw;
geneSetA_ = geneSetA & 0xffffffff;
inputGeneA1Raw = geneSetA_ >> 2 & 3;
inputGeneB0 = array0_1_1_2[(ulonglong)geneSetB & 3];
if (array0_1_1_2[geneSetA & 3] == 2) {
outputGene0 = 1;
inputGeneA1 = array0_1_1_2[inputGeneA1Raw];
}
else {
if (array0_1_1_2[geneSetA & 3] == 1) {
iVar1 = randomValueFromGrowUpRNG(2);
outputGene0 = (uint)(iVar1 == 0);
inputGeneA1 = array0_1_1_2[inputGeneA1Raw];
}
else {
outputGene0 = 0;
inputGeneA1 = array0_1_1_2[inputGeneA1Raw];
}
}
inputGeneB1Raw = (ulonglong)(geneSetB >> 2) & 3;
if (inputGeneB0 == 2) {
outputGene0 = outputGene0 + 1;
inputGeneB1 = array0_1_1_2[inputGeneB1Raw];
}
else {
if ((inputGeneB0 == 1) && (iVar1 = randomValueFromGrowUpRNG(2), iVar1 == 0)) {
outputGene0 = outputGene0 + 1;
}
inputGeneB1 = array0_1_1_2[inputGeneB1Raw];
}
inputGeneA2Raw = geneSetA_ >> 4 & 3;
if (inputGeneA1 == 2) {
outputGene1 = 1;
inputGeneA2 = array0_1_1_2[inputGeneA2Raw];
}
else {
if (inputGeneA1 == 1) {
iVar1 = randomValueFromGrowUpRNG(2);
outputGene1 = (uint)(iVar1 == 0);
inputGeneA2 = array0_1_1_2[inputGeneA2Raw];
}
else {
outputGene1 = 0;
inputGeneA2 = array0_1_1_2[inputGeneA2Raw];
}
}
inputGeneB2Raw = (ulonglong)(geneSetB >> 4) & 3;
if (inputGeneB1 == 2) {
outputGene1 = outputGene1 + 1;
inputGeneB2 = array0_1_1_2[inputGeneB2Raw];
}
else {
if ((inputGeneB1 == 1) && (iVar1 = randomValueFromGrowUpRNG(2), iVar1 == 0)) {
outputGene1 = outputGene1 + 1;
}
inputGeneB2 = array0_1_1_2[inputGeneB2Raw];
}
inputGeneA3Raw = geneSetA_ >> 6 & 3;
if (inputGeneA2 == 2) {
outputGene2 = 1;
inputGeneA3 = array0_1_1_2[inputGeneA3Raw];
}
else {
if (inputGeneA2 == 1) {
iVar1 = randomValueFromGrowUpRNG(2);
outputGene2 = (uint)(iVar1 == 0);
inputGeneA3 = array0_1_1_2[inputGeneA3Raw];
}
else {
outputGene2 = 0;
inputGeneA3 = array0_1_1_2[inputGeneA3Raw];
}
}
inputGeneB3Raw = (ulonglong)(geneSetB >> 6) & 3;
if (inputGeneB2 == 2) {
outputGene2 = outputGene2 + 1;
inputGeneB3 = array0_1_1_2[inputGeneB3Raw];
}
else {
if ((inputGeneB2 == 1) && (iVar1 = randomValueFromGrowUpRNG(2), iVar1 == 0)) {
outputGene2 = outputGene2 + 1;
}
inputGeneB3 = array0_1_1_2[inputGeneB3Raw];
}
if (inputGeneA3 == 2) {
outputGene3 = 1;
}
else {
if (inputGeneA3 == 1) {
iVar1 = randomValueFromGrowUpRNG(2);
outputGene3 = (uint)(iVar1 == 0);
}
else {
outputGene3 = 0;
}
}
if (inputGeneB3 == 2) {
outputGene3 = outputGene3 + 1;
}
else {
if ((inputGeneB3 == 1) && (iVar1 = randomValueFromGrowUpRNG(2), iVar1 == 0)) {
outputGene3 = outputGene3 + 1;
}
}
return (uint)array_0_1_3[outputGene0] |
((uint)array_0_1_3[outputGene1] |
((uint)array_0_1_3[outputGene2] | (uint)array_0_1_3[outputGene3] << 2) << 2) << 2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment