From a30267bad7651758de27a9e497a7bc8902200647 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 3 Mar 2019 00:37:29 +0100 Subject: [PATCH] 3d:: binary:: celldistance for heptagons --- binary-tiling.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/binary-tiling.cpp b/binary-tiling.cpp index e575f34c..59e047d2 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -372,10 +372,10 @@ bool pseudohept(cell *c) { return (c->master->zebraval == 1) && (c->master->distance & 1); } -int celldistance3(cell *c1, cell *c2) { // [untested] +int celldistance3(heptagon *c1, heptagon *c2) { int steps = 0; - int d1 = celldistAlt(c1); - int d2 = celldistAlt(c2); + int d1 = c1->distance; + int d2 = c2->distance; while(d1 > d2) c1 = c1->cmove(8), steps++, d1--; while(d2 > d1) c2 = c2->cmove(8), steps++, d2--; vector dx, dy; @@ -399,6 +399,8 @@ int celldistance3(cell *c1, cell *c2) { // [untested] } return steps; } + +int celldistance3(cell *c1, cell *c2) { return celldistance3(c1->master, c2->master); } #endif