1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-18 15:00:26 +00:00

fixed celldistAlt in bitruncated {4,x}

This commit is contained in:
Zeno Rogue 2020-04-20 03:50:13 +02:00
parent d09acee7a8
commit 052be86915

View File

@ -119,22 +119,41 @@ heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fix
if(h->c.spin(0) == 2 && h->move(0)) {
int d = h->c.spin(0);
int d1 = (d+S7-1)%S7;
bool missing0 = !h->move(0)->move(d1);
if(missing0) {
if(s == 1)
h->distance = h->move(0)->distance + 1;
}
else {
heptagon* h1 = createStep(h->move(0), d1);
if(h1->distance <= h->move(0)->distance)
h->distance = h->move(0)->distance+1;
}
}
if((h->s == hsB && h->move(0)->s == hsB) || h->move(0)->s == hsA) {
int d = h->c.spin(0);
heptagon* h1 = createStep(h->move(0), (d+1)%S7);
if(h1->distance <= h->move(0)->distance)
h->distance = h->move(0)->distance+1;
}
if(h->c.spin(0) == S7-1 && h->move(0)->distance != 0)
if(h->c.spin(0) == S7-1 && (h->move(0)->s != hsOrigin) && BITRUNCATED) {
bool missing = !h->move(S7-1);
if(missing) {
h->distance = parent->distance;
if(
parent->distance - h->move(0)->move(0)->distance == 1 &&
h->c.spin(0) == S7 - 1 &&
h->move(0)->c.spin(0) == 2)
h->distance++;
}
else {
h->distance = min(
h->move(0)->move(0)->distance + 2,
createStep(h, S7-1)->distance + 1
);
}
}
}
else if(parent->s == hsOrigin) h->distance = parent->distance + gp::dist_2();
#if CAP_GP
else if(S3 == 4 && GOLDBERG && h->c.spin(0) == S7-2 && h->move(0)->c.spin(0) >= S7-2 && h->move(0)->move(0)->s != hsOrigin) {
@ -190,6 +209,9 @@ heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fix
}
else {
h->distance = parent->distance - gp::dist_2();
if(S3 == 4 && S7 > 5 && BITRUNCATED) {
h->distance = parent->distance - 2;
}
if(S3 == 4 && S7 == 5) {
if(h->s == hsOrigin) {
printf("had to cheat!\n");