diff --git a/bigstuff.cpp b/bigstuff.cpp index b14802d5..184e4fb9 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -915,8 +915,8 @@ void buildBigStuff(cell *c, cell *from) { else if(c->land == laPrairie && c->LHU.fi.walldist == 0) { for(int bd=0; bd<7; bd++) { int fval2 = createStep(c->master, bd)->fieldval; - int wd = fp43.gmul(fval2, fp43.inverses[c->fval-1]); - if(fp43.distwall[wd] == 0) { + int wd = currfp.gmul(fval2, currfp.inverses[c->fval-1]); + if(currfp.distwall[wd] == 0) { buildBarrier(c, bd); break; } diff --git a/cell.cpp b/cell.cpp index 23479ce4..590352b5 100644 --- a/cell.cpp +++ b/cell.cpp @@ -487,7 +487,7 @@ struct hrmap_quotient : hrmap { hrmap_quotient() { if(quotient == 2) { - connections = fp43.connections; + connections = currfp.connections; } else { heptspin hs; hs.h = base.origin; hs.spin = 0; @@ -715,7 +715,7 @@ void initcells() { allmaps.push_back(currentmap); - if(S7 <= 7 && S6 <= 6) windmap::create(); + windmap::create(); // origin->emeraldval = } @@ -824,8 +824,8 @@ bool ishex1(cell *c) { int emeraldval(cell *c) { if(euclid) return eupattern(c); - if(sphere || weirdhyperbolic) return 0; - if(c->type == 7) + if(sphere) return 0; + if(ctof(c)) return c->master->emeraldval >> 3; else { return emerald_hexagon( @@ -1045,8 +1045,8 @@ int fiftyval049(cell *c) { // zebraval int zebra40(cell *c) { - if(c->type != 6) return (c->master->zebraval/10); - else if(sphere || S7>7 || S6>6) return 0; + if(ctof(c)) return (c->master->zebraval/10); + else if(sphere) return 0; else if(euclid) return eupattern(c); else { int ii[3], z; @@ -1403,7 +1403,7 @@ cell *heptatdir(cell *c, int d) { namespace fieldpattern { pair fieldval(cell *c) { - if(c->type == 7) return make_pair(c->master->fieldval, false); + if(ctof(c)) return make_pair(c->master->fieldval, false); else return make_pair(btspin(c->master->fieldval, c->spin(0)), true); } @@ -1423,10 +1423,10 @@ int fieldval_uniq(cell *c) { if(i<0) i += torusconfig::qty; return i; } - if(ctof(c)) return c->master->fieldval/7; + if(ctof(c)) return c->master->fieldval/S7; else { int z = 0; - for(int u=0; u<6; u+=2) + for(int u=0; umaster->fieldval, c->spin(u))); return -1-z; } @@ -1436,28 +1436,32 @@ int fieldval_uniq_rand(cell *c, int randval) { if(sphere || torus || euclid) // we do not care in these cases return fieldval_uniq(c); - if(c->type != 6) return fp43.gmul(c->master->fieldval, randval)/7; + if(ctof(c)) return currfp.gmul(c->master->fieldval, randval)/7; else { int z = 0; for(int u=0; u<6; u+=2) - z = max(z, btspin(fp43.gmul(createMov(c, u)->master->fieldval, randval), c->spin(u))); + z = max(z, btspin(currfp.gmul(createMov(c, u)->master->fieldval, randval), c->spin(u))); return -1-z; } } -int subpathid = fp43.matcode[fp43.strtomatrix("RRRPRRRRRPRRRP")]; -int subpathorder = fp43.order(fp43.matrices[subpathid]); +int subpathid = currfp.matcode[currfp.strtomatrix("RRRPRRRRRPRRRP")]; +int subpathorder = currfp.order(currfp.matrices[subpathid]); pair subval(cell *c, int _subpathid = subpathid, int _subpathorder = subpathorder) { - if(c->type == 6) - return min(min(subval(createMov(c, 0)),subval(createMov(c, 2))), subval(createMov(c, 4))); + if(!ctof(c)) { + auto m = subval(createMov(c, 0)); + for(int u=2; u pbest, pcur; pcur.first = c->master->fieldval; pcur.second = 0; pbest = pcur; for(int i=0; i<_subpathorder; i++) { - pcur.first = fp43.gmul(pcur.first, _subpathid); + pcur.first = currfp.gmul(pcur.first, _subpathid); pcur.second++; if(pcur < pbest) pbest = pcur; } @@ -1485,7 +1489,7 @@ int celldistance(cell *c1, cell *c2) { } if(quotient == 2) - return fp43.getdist(fieldpattern::fieldval(c1), fieldpattern::fieldval(c2)); + return currfp.getdist(fieldpattern::fieldval(c1), fieldpattern::fieldval(c2)); int d1 = celldist(c1), d2 = celldist(c2); diff --git a/classes.cpp b/classes.cpp index 5a92f440..0241dc28 100644 --- a/classes.cpp +++ b/classes.cpp @@ -1866,14 +1866,16 @@ eLand land_sph[LAND_SPH] = { laWildWest, laPalace, laBull, laPrairie, laCA }; -#define LAND_OCT 25 +#define LAND_OCT 33 eLand land_oct[LAND_OCT] = { laIce, laDesert, laCaves, laJungle, laAlchemist, laGraveyard, laRlyeh, laHell, laCocytus, laMotion, laDryForest, laDeadCaves, laRedRock, laMinefield, laLivefjord, laStorms, laOvergrown, laRose, laKraken, laBurial, laTrollheim, laBull, laHunting, - laCaribbean, laCamelot + laCaribbean, laCamelot, laPalace, laMirrorOld, + laVolcano, laBlizzard, laTerracotta, + laWineyard, laPower, laEmerald }; diff --git a/complex.cpp b/complex.cpp index 6a1f7251..eada6ad0 100644 --- a/complex.cpp +++ b/complex.cpp @@ -1124,20 +1124,20 @@ namespace mirror { } return; } - for(int i=0; i<6; i++) { + for(int i=0; itype == 6) { + if(!ctof(cw.c)) { cwspin(cw, 2); cwstep(cw); - cwspin(cw, 4-i); + cwspin(cw, S6-2-i); createMirror(cw, cpid); - cwspin(cw, 6-4+i); + cwspin(cw, 2+i); cwstep(cw); - cwspin(cw, 2); + cwspin(cw, S6-4); cwstep(cw); cwspin(cw, 2-i); createMirror(cw, cpid); - cwspin(cw, 6-2+i); + cwspin(cw, S6-2+i); cwstep(cw); cwspin(cw, 2); } @@ -2066,6 +2066,7 @@ void livecaves() { else if(w == waGargoyle) c->aitmp--; else if(w == waGargoyleFloor) c->aitmp--; else if(w == waGargoyleBridge) c->aitmp--; + else if(w == waStone) ; else if(w == waDeadTroll) c->aitmp -= 5; else if(w == waDeadTroll2) c->aitmp -= 3; else if(w == waPetrified || w == waPetrifiedBridge) c->aitmp -= 2; @@ -2703,9 +2704,9 @@ namespace prairie { } else { if(!from) { - for(int i=0; ifval = fp43.inverses[i]+1; + for(int i=0; ifval = currfp.inverses[i]+1; } else if(from && from->land == laPrairie && from->fval) c->fval = from->fval; @@ -2729,15 +2730,15 @@ namespace prairie { } } pair fv = fieldpattern::fieldval(c); - fv = fp43.gmul(fv, fp43.inverses[c->fval-1]); + fv = currfp.gmul(fv, fp43.inverses[c->fval-1]); - rd = fp43.getdist(fv, fp43.distriver); - int rl = fp43.getdist(fv, fp43.distriverleft); - int rr = fp43.getdist(fv, fp43.distriverright); + rd = currfp.getdist(fv, fp43.distriver); + int rl = currfp.getdist(fv, fp43.distriverleft); + int rr = currfp.getdist(fv, fp43.distriverright); - c->LHU.fi.flowerdist = fp43.getdist(fv, fp43.distflower); - c->LHU.fi.walldist = fp43.getdist(fv, fp43.distwall); - c->LHU.fi.walldist2 = fp43.getdist(fv, fp43.distwall2); + c->LHU.fi.flowerdist = currfp.getdist(fv, fp43.distflower); + c->LHU.fi.walldist = currfp.getdist(fv, fp43.distwall); + c->LHU.fi.walldist2 = currfp.getdist(fv, fp43.distwall2); c->LHU.fi.rval = 0; if(rd <= 7 && rl < rr) @@ -2751,7 +2752,7 @@ namespace prairie { if(c->LHU.fi.walldist == 0) c->wall = waBarrier; if(0) if(c->type == 7) for(int i=0; i<7; i++) { - eItem m = fp43.markers[fieldpattern::btspin(c->master->fieldval,i)]; + eItem m = currfp.markers[fieldpattern::btspin(c->master->fieldval,i)]; if(m) { if(c->item) c->item = itBuggy2; else c->item = m, c->mondir = i; @@ -3054,12 +3055,15 @@ namespace windmap { if(N == 18920) precomp = windcodes18920; if(N == 5676) precomp = windcodes5676; - if(precomp && size(fp43.matrices)) { - int randval = hrand(size(fp43.matrices)); + if(precomp && size(currfp.matrices)) { + int randval = hrand(size(currfp.matrices)); for(int i=0; i= 200*N) break; + if(a >= 200*N) { printf("does not converge\n"); break; } int bestval = 1000000000, best = 0; int i = tocheck[a]; for(int k=0; k<256; k++) { @@ -3089,7 +3093,19 @@ namespace windmap { inqueue[i] = false; windcodes[i] = best; } - if(false) { + + int ingroup[4]; + for(int u=0; u<4; u++) ingroup[u] = 0; + for(int i=0; i> 6]++; + for(int u=0; u<4; u++) if(!ingroup[u]) { + tries++; + if(tries < 5) goto tryagain; + } + if(tries >= 5) { + addMessage("Failed to generate an interesting wind/lava pattern."); + } + + if(true) { printf("tocheck size = %d\n", size(tocheck)); printf("if(N == %d) {\n", N); printf(" windcodes = {"); @@ -3101,7 +3117,6 @@ namespace windmap { } int at(cell *c) { - if(weirdhyperbolic) return ((size_t)c) % 255; return windmap::windcodes[windmap::getId(c)]; } diff --git a/control.cpp b/control.cpp index cc0e9b2c..4910392b 100644 --- a/control.cpp +++ b/control.cpp @@ -68,7 +68,6 @@ movedir vectodir(const hyperpoint& P) { binv = dirdist[i]; res.d = i; res.subdir = dirdist[(i+1)%cwt.c->type] < dirdist[(i+cwt.c->type-1)%cwt.c->type] ? 1 : -1; - if(sphere) res.subdir = -res.subdir; } } @@ -117,8 +116,6 @@ void calcMousedest() { if(cwt.mirrored) mousedest.d = fixdir(-mousedest.d, cwt.c), mousedest.subdir = -mousedest.subdir; - - if(sphere) mousedest.subdir = -mousedest.subdir; } if(vid.revcontrol == true) { mouseh[0] = -mouseh[0]; mouseh[1] = -mouseh[1]; } diff --git a/fieldpattern.cpp b/fieldpattern.cpp index 272defb5..360020b0 100644 --- a/fieldpattern.cpp +++ b/fieldpattern.cpp @@ -34,7 +34,7 @@ bool operator < (const matrix& A, const matrix& B) { } int btspin(int id, int d) { - return 7*(id/7) + (id + d) % 7; + return S7*(id/S7) + (id + d) % S7; } struct fpattern { @@ -153,8 +153,8 @@ struct fpattern { vector connections; vector inverses; - vector rrf; // rrf[i] equals gmul(i, 6) - vector rpf; // rpf[i] equals gmul(i, 7) + vector rrf; // rrf[i] equals gmul(i, S7-1) + vector rpf; // rpf[i] equals gmul(i, S7) matrix mpow(matrix M, int N) { while((N&1) == 0) N >>= 1, M = mmul(M, M); @@ -184,7 +184,7 @@ struct fpattern { string decodepath(int i) { string s; while(i) { - if(i % 7) i--, s += 'R'; + if(i % S7) i--, s += 'R'; else i = connections[i], s += 'P'; } return s; @@ -242,7 +242,10 @@ struct fpattern { R[0][1] = sn; R[1][0] = sub(0, sn); matrix Z = R; - for(int i=0; i<6; i++) Z = mmul(Z, R); + for(int i=1; i disthep[otherpole]) otherpole = i; - // for(int r=0; r<7; r++) { + // for(int r=0; rtype == 6) return 1; // irrelevant - cwspin(bull, 3); dirs[0] = positive = bull.spin; - cwspin(bull, -6); dirs[1] = bull.spin; + if(!(c2->type & 1)) return 1; // irrelevant + int d = c2->type / 2; + cwspin(bull, d); dirs[0] = positive = bull.spin; + cwspin(bull, -2*d); dirs[1] = bull.spin; determinizeBull(c2, dirs, nc); if(dirs[0] == positive) return -1; return 1; @@ -3660,11 +3661,11 @@ template cell *determinePush(cellwalker who, cell *c2, int subdir, T valid) { cellwalker push = who; cwstep(push); - int pd = push.c->type == 8 ? 4 : 3; + int pd = push.c->type/2; cwspin(push, pd * -subdir); cwstep(push); if(valid(push.c)) return push.c; - if(c2->type == 7) { + if(c2->type&1) { cwstep(push); cwspin(push, 1 * -subdir); cwstep(push); diff --git a/graph.cpp b/graph.cpp index 68507910..3002b57e 100644 --- a/graph.cpp +++ b/graph.cpp @@ -2176,6 +2176,10 @@ void drawTowerFloor(const transmatrix& V, cell *c, int col, cellfunction *cf = c void drawZebraFloor(const transmatrix& V, cell *c, int col) { if(euclid) { qfloor(c, V, shTower[10], col); return; } + if(weirdhyperbolic) { + int ct6 = ctof(c); + qfloor(c, V, PLAINFLOOR, col); return; + } int i = zebra40(c); i &= ~3; @@ -5309,7 +5313,7 @@ auto graphcm = addHook(clearmemory, 0, [] () { void resetGeometry() { precalc(); - fp43.analyze(); + currfp.analyze(); #if CAP_GL resetGL(); #endif diff --git a/heptagon.cpp b/heptagon.cpp index 7241d4ad..f78d3219 100644 --- a/heptagon.cpp +++ b/heptagon.cpp @@ -4,13 +4,13 @@ // heptagon here refers to underlying heptagonal tesselation // (which you can see by changing the conditions in graph.cpp) -#define MIRR(x) x.mirrored - // automaton state enum hstate { hsOrigin, hsA, hsB, hsError, hsA0, hsA1, hsB0, hsB1, hsC }; #define MODFIXER 23520 +#define MIRR(x) x.mirrored + int fixrot(int a) { return (a+MODFIXER)% S7; } int fix42(int a) { return (a+MODFIXER)% S42; } @@ -133,15 +133,13 @@ heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fix if(parent->c7) { h->c7 = newCell(S7, h); h->rval0 = h->rval1 = 0; h->cdata = NULL; - if(!weirdhyperbolic) { - h->emeraldval = emerald_heptagon(parent->emeraldval, d); - h->zebraval = zebra_heptagon(parent->zebraval, d); - h->fieldval = fp43.connections[fieldpattern::btspin(parent->fieldval, d)]; - if(parent->s == hsOrigin) - h->fiftyval = fiftytable[0][d]; - else - h->fiftyval = nextfiftyval(parent->fiftyval, parent->move[0]->fiftyval, d); - } + h->emeraldval = emerald_heptagon(parent->emeraldval, d); + h->zebraval = zebra_heptagon(parent->zebraval, d); + h->fieldval = currfp.connections[fieldpattern::btspin(parent->fieldval, d)]; + if(parent->s == hsOrigin) + h->fiftyval = firstfiftyval(d); + else + h->fiftyval = nextfiftyval(parent->fiftyval, parent->move[0]->fiftyval, d); } else { h->c7 = NULL; diff --git a/hyper.cpp b/hyper.cpp index 1e9668f2..fa2962dd 100644 --- a/hyper.cpp +++ b/hyper.cpp @@ -236,7 +236,7 @@ else if(args()[0] == '-' && args()[1] == x && args()[2] == '0') { showstartmenu } else if(argis("-qs")) { autocheat = true; - shift(); fp43.qpaths.push_back(args()); + shift(); currfp.qpaths.push_back(args()); } else if(argis("-fix")) { fixseed = true; autocheat = true; @@ -255,7 +255,7 @@ else if(args()[0] == '-' && args()[1] == x && args()[2] == '0') { showstartmenu &p, "ientspace::rvadd, "ientspace::rvdir ); autocheat = true; - fp43.init(p); + currfp.init(p); } else if(argis("-tpar")) { shift(); sscanf(args(), "%d,%d,%d", @@ -266,14 +266,14 @@ else if(args()[0] == '-' && args()[1] == x && args()[2] == '0') { showstartmenu } else if(argis("-cs")) { shift(); - fieldpattern::matrix M = fp43.strtomatrix(args()); - fieldpattern::subpathid = fp43.matcode[M]; - fieldpattern::subpathorder = fp43.order(M); + fieldpattern::matrix M = currfp.strtomatrix(args()); + fieldpattern::subpathid = currfp.matcode[M]; + fieldpattern::subpathorder = currfp.order(M); autocheat = true; } else if(argis("-csp")) { autocheat = true; - fp43.findsubpath(); + currfp.findsubpath(); } else if(argis("-fi")) { fieldpattern::info(); diff --git a/landgen.cpp b/landgen.cpp index 80c9bb25..ba3615b5 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -313,7 +313,8 @@ void giantLandSwitch(cell *c, int d, cell *from) { } else { int v = emeraldval(c); - if((v&3) >= 2) + if(v == 0) c->wall = waStone; + else if((v&3) >= 2) c->wall = waCavewall; else c->wall = waCavefloor; } @@ -373,19 +374,22 @@ void giantLandSwitch(cell *c, int d, cell *from) { if(y0 == 3 || y0 == 4) v=24; else v=0; } else v = emeraldval(c); - v &= ~3; - if((v == 24 || v == 32 || v == 56)) - c->wall = waEternalFire; - else if(hrand(100) < 10) { - c->wall = waGlass; - eItem protectedItems[18] = { - itPower, itPower, itPower, itPower, itPower, itPower, - itOrbLightning, itOrbLightning, itOrbThorns, itOrbThorns, - itOrbInvis, itOrbInvis, - itOrbShield, itOrbTeleport, itOrbPsi, - itOrbDragon, itOrbIllusion, itOrbTime - }; - c->item = protectedItems[hrand(18)]; + if(v == 0) c->wall = waStone; + else { + v &= ~3; + if((v == 24 || v == 32 || v == 56)) + c->wall = waEternalFire; + else if(hrand(100) < 10) { + c->wall = waGlass; + eItem protectedItems[18] = { + itPower, itPower, itPower, itPower, itPower, itPower, + itOrbLightning, itOrbLightning, itOrbThorns, itOrbThorns, + itOrbInvis, itOrbInvis, + itOrbShield, itOrbTeleport, itOrbPsi, + itOrbDragon, itOrbIllusion, itOrbTime + }; + c->item = protectedItems[hrand(18)]; + } } } // seal entrances to the Land of Power. @@ -411,7 +415,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { itOrbFlash, itOrbSpeed, itOrbFire, itOrbWinter, itOrbAether, itOrbLife}; c->item = powerorbs[hrand(6)]; } - else if(c->type == 6 && hrand(5000) < 10) + else if(!ctof(c) && hrand(5000) < 10) c->wall = hrand(2) ? waMirror : waCloud; else if(hrand(1000) < 10 + (items[itPower] ? 10:0) + (items[itPower] + yendor::hardness())) c->monst = eMonster(moWitch + hrand(NUMWITCH)); @@ -449,16 +453,19 @@ void giantLandSwitch(cell *c, int d, cell *from) { } else { int v = emeraldval(c); - int w = v / 4; - if(randomPatternsMode) c->wall = RANDPAT ? waVinePlant : waNone; - else if(w == 9 || w == 10 || w == 7 || w == 8) { - c->wall = waVinePlant; + if(v == 0) c->wall = waStone; + else { + int w = v / 4; + if(randomPatternsMode) c->wall = RANDPAT ? waVinePlant : waNone; + else if(w == 9 || w == 10 || w == 7 || w == 8) { + c->wall = waVinePlant; + } + else if(v == 24 || v == 58 || v == 26 || v == 56) + c->wall = waVineHalfA; + else if(v == 25 || v == 59 || v == 27 || v == 57) + c->wall = waVineHalfB; + else c->wall = waNone; } - else if(v == 24 || v == 58 || v == 26 || v == 56) - c->wall = waVineHalfA; - else if(v == 25 || v == 59 || v == 27 || v == 57) - c->wall = waVineHalfB; - else c->wall = waNone; } } if(d == 7 && c->wall == waVinePlant && hrand(100) < (randomPatternsMode ? 2 : 10) && !peace::on) @@ -1841,11 +1848,11 @@ void giantLandSwitch(cell *c, int d, cell *from) { ONEMPTY { if(purehepta && c->land == laCrossroads5 && hrand(100) < 60) c->wall = waBarrier; - else if(c->type == 6 && !inv::on && items[itShard] >= 10 && hrand(8000) < 120*orbcrossfun(items[itShard])) + else if(!ctof(c) && !inv::on && items[itShard] >= 10 && hrand(8000) < 120*orbcrossfun(items[itShard])) c->wall = hrand(2) ? waMirror : waCloud; - else if(c->type == 6 && hyperstonesUnlocked() && hrand(8000) < 100) + else if(!ctof(c) && hyperstonesUnlocked() && hrand(8000) < 100) c->wall = hrand(2) ? waMirror : waCloud; - else if(c->type == 6 && tactic::on && isCrossroads(tactic::lasttactic) && hrand(8000) < 120) + else if(!ctof(c) && tactic::on && isCrossroads(tactic::lasttactic) && hrand(8000) < 120) c->wall = hrand(2) ? waMirror : waCloud; else if(c->land == laCrossroads4 && hrand(24000) < 10 && tactic::on) c->wall = waRose; diff --git a/mapeditor.cpp b/mapeditor.cpp index efd72b16..635e930c 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -1752,22 +1752,22 @@ namespace mapeditor { int generateCanvas(cell *c) { if(whichCanvas == 'C') { using namespace fieldpattern; - int z = fp43.getdist(fieldval(c), make_pair(0,false)); - if(z < fp43.circrad) return 0x00C000; - int z2 = fp43.getdist(fieldval(c), make_pair(fp43.otherpole,false)); - if(z2 < fp43.disthep[fp43.otherpole] - fp43.circrad) + int z = currfp.getdist(fieldval(c), make_pair(0,false)); + if(z < currfp.circrad) return 0x00C000; + int z2 = currfp.getdist(fieldval(c), make_pair(fp43.otherpole,false)); + if(z2 < currfp.disthep[fp43.otherpole] - fp43.circrad) return 0x3000; return 0x6000; } if(whichCanvas == 'D') { using namespace fieldpattern; - int z = fp43.getdist(fieldval(c), make_pair(0,false)); - return 255 * (fp43.maxdist+1-z) / fp43.maxdist; + int z = currfp.getdist(fieldval(c), make_pair(0,false)); + return 255 * (currfp.maxdist+1-z) / fp43.maxdist; } if(whichCanvas == 'N') { using namespace fieldpattern; - int z = fp43.getdist(fieldval(c), make_pair(0,false)); - int z2 = fp43.getdist(fieldval(c), make_pair(fp43.otherpole,false)); + int z = currfp.getdist(fieldval(c), make_pair(0,false)); + int z2 = currfp.getdist(fieldval(c), make_pair(fp43.otherpole,false)); if(z < z2) return 0x00C000; if(z > z2) return 0xC00000; return 0xCCCC00; diff --git a/menus.cpp b/menus.cpp index 4887598f..dcc2ab60 100644 --- a/menus.cpp +++ b/menus.cpp @@ -650,7 +650,7 @@ void showPickGeometry() { if(tq & qTORUS) worldsize = torusconfig::qty; if(tq & qZEBRA) worldsize = targettrunc ? 12 : 40; if(tq & qFIELD) { - worldsize = size(fp43.matrices) / ts; + worldsize = size(currfp.matrices) / ts; if(!targettrunc) worldsize = (10*worldsize) / 3; } diff --git a/patterns.cpp b/patterns.cpp index 5a643be2..864bd725 100644 --- a/patterns.cpp +++ b/patterns.cpp @@ -7,6 +7,8 @@ // rules for the emeraldvalues of heptagons. int emerald_heptagon(int parent, int dir) { + if(S7 == 8 && dir > 3) dir--; + // no emeraldgen here if(parent == 0) return 0; @@ -357,6 +359,7 @@ int emerald_heptagon(int parent, int dir) { #undef RULE + if(weirdhyperbolic) return 0; printf("HEPTAGONAL RULE MISSING for (%d,%d)\n", parent,dir); exit(1); } @@ -408,7 +411,8 @@ int emerald_hexagon(int a, int b, int c) { if(a==34 && b == 35 && c== 41) return 59; if(a==34 && b == 40 && c== 35) return 58; if(a==34 && b == 41 && c== 35) return 25; - printf("HEXAGONAL RULE MISSING for (%d,%d,%d)\n", a,b,c); + if(!weirdhyperbolic) + printf("HEXAGONAL RULE MISSING for (%d,%d,%d)\n", a,b,c); return 0; // exit(1); } @@ -1005,9 +1009,16 @@ RULE50(0x1df, 0x0c6, 0x1ae, 0x0ff, 0x0df, 0x1b7, 0x0f7, 0x1a6) #undef RULE50 +int firstfiftyval(int d) { + if(S7 == 8 && d > 3) d--; + return fiftytable[0][d]; + } + int nextfiftyval(int par, int gpar, int d) { + if(S7 == 8 && d > 3) d--; for(int i=0; i<7; i++) if(fiftytable[par][i] == gpar) return fiftytable[par][(i+d)%7]; + if(weirdhyperbolic) return 0; printf("fifty pattern error!\n"); exit(1); } @@ -1052,6 +1063,7 @@ int zebratable6[28][3] = { // rules for the emeraldvalues of heptagons. int zebra_heptagon(int parent, int dir) { + if(S7 == 8 && dir > 3) dir--; return zebratable[parent/10-4][(70+dir-(parent%10))%7]; }