From 06c57adf4a870a48c7a5663989b38161f709ff80 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 21 Aug 2018 16:50:53 +0200 Subject: [PATCH] fixed the Chessboard pattern --- archimedean.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/archimedean.cpp b/archimedean.cpp index 76df4b9b..1283fb31 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -455,8 +455,17 @@ heptagon *build_child(heptspin p, pair adj) { int nei = neighbors_of(h); h->c7 = newCell(nei, h); h->distance = p.at->distance + 1; - if(adj.first < 2*current.N) - h->fieldval = p.at->move(0)->fieldval + (adj.second/2); + if(adj.first < 2*current.N) { + int s = 0; + heptspin hs(p); + while(id_of(hs.at->move(0)) >= 2 * current.N) { + s += hs.spin / 2 - 1; + hs = hs - hs.spin + wstep - 1; + } + h->fieldval = hs.at->move(0)->fieldval + s + hs.spin/2; + } + else + h->fieldval = -100; h->fiftyval = isize(archimedean_gmatrix); heptspin hs(h, 0); return h;