From 993ef1b1647194d643d119eb81e401134ea2f1b2 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 30 Aug 2018 16:02:35 +0200 Subject: [PATCH] random pseudohept in Archimedean duals --- archimedean.cpp | 13 +++++++++---- floorshapes.cpp | 4 ++-- pattern2.cpp | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/archimedean.cpp b/archimedean.cpp index 60824754..34803a46 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -539,6 +539,7 @@ heptagon *build_child(heptspin p, pair adj) { else h->rval1 = 3 - p.at->move(0)->rval1 - p.at->rval1; } + h->rval0 = hrand(256); heptspin hs(h, 0); return h; } @@ -848,7 +849,10 @@ bool archimedean_tiling::support_chessboard() { return N % 2 == 0; } -bool pseudohept(int id) { +bool pseudohept(cell *c) { + if(DUAL) + return !(c->master->rval0 & 3); + int id = id_of(c->master); if(PURE) return current.flags[id] & arcm::sfPH; if(BITRUNCATED) @@ -866,12 +870,13 @@ bool linespattern(cell *c) { return current.flags[id_of(c->master)] & arcm::sfLINE; } -int threecolor(int id) { +int threecolor(cell *c) { if(current.have_ph) - return !pseudohept(id); + return !arcm::pseudohept(c); else if(PURE) - return current.tilegroup[id]; + return current.tilegroup[id_of(c->master)]; else { + int id = id_of(c->master); if(current.support_threecolor() == 2) return id < current.N * 2 ? (id&1) : 2; return current.tilegroup[id]; } diff --git a/floorshapes.cpp b/floorshapes.cpp index e2a7e832..69f7ba08 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -503,9 +503,9 @@ void generate_floorshapes() { if(DUAL) model.type /= 2, arcm::parent_index_of(&master) = !(i&1); if(BITRUNCATED) - generate_floorshapes_for(i, &model, !arcm::pseudohept(i), arcm::pseudohept(i) ? 0 : 1^(i&1)); + generate_floorshapes_for(i, &model, !arcm::pseudohept(&model), arcm::pseudohept(&model) ? 0 : 1^(i&1)); else if(geosupport_football() == 2) - generate_floorshapes_for(i, &model, !arcm::pseudohept(i), i >= 4 ? 1 : 0); + generate_floorshapes_for(i, &model, !arcm::pseudohept(&model), i >= 4 ? 1 : 0); else generate_floorshapes_for(i, &model, 0, 0); } diff --git a/pattern2.cpp b/pattern2.cpp index 49cff50f..99ec0f98 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -1112,7 +1112,7 @@ int geosupport_football() { int pattern_threecolor(cell *c) { if(archimedean) { if(PURE) - return arcm::threecolor(arcm::id_of(c->master)); + return arcm::threecolor(c); else /* if(BITRUNCATED) */ return c->master->rval1; } @@ -1217,7 +1217,7 @@ int pattern_threecolor(cell *c) { bool pseudohept(cell *c) { if(IRREGULAR) return irr::pseudohept(c); if(binarytiling) return c->type & c->master->distance & 1; - if(archimedean) return arcm::pseudohept(arcm::id_of(c->master)); + if(archimedean) return arcm::pseudohept(c); if(GOLDBERG && gp_threecolor() == 2) return gp::pseudohept_val(c) == 0; if(GOLDBERG && gp_threecolor() == 1 && (S7&1) && (S3 == 3))