From dd113c0f46ed6e034f8ddc98452fd8abd0bf41f0 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Wed, 16 Sep 2020 18:48:32 +0200 Subject: [PATCH] chessboard pattern in unrectified {4,n} tilings --- pattern2.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pattern2.cpp b/pattern2.cpp index 82306af3..eeea2a2a 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -90,6 +90,28 @@ EX int chessvalue(cell *c) { #if CAP_GP if(WARPED) return gp::untruncated_shift(c) == 2; + else if(UNRECTIFIED && a4) { + auto li = gp::get_local_info(c); + bool odd_a = gp::param.first & 1; + bool odd_b = gp::param.second & 1; + bool odd_S7 = S7 & 1; + // odd-odd + if(odd_a && odd_b) + return (li.relative.second & 1) ^ (li.last_dir & 1) ^ (c->master->dm4 & 1) ^ ((c->master->emeraldval & 1) ? 1 : 0); + else if(odd_a || odd_b) { + /* int swapped = 0; + cellwalker cw(c, 0); + while((li.relative.first ^ li.relative.second) & 1) { + cw += wstep; cw += 2; swapped ^= 1; + } */ + if((li.relative.first ^ li.relative.second) & 1) + return (li.relative.first & 1) ^ ((c->master->cmove(0)->emeraldval & 4) ? 1 : 0); + else + return (li.relative.first & 1) ^ ((c->master->emeraldval & 4) ? 1 : 0); + } + else + return (li.relative.second & 1) ^ (li.last_dir & 1) ^ ((c->master->emeraldval & 1) ? 1 : 0); + } else #endif return celldist(c) & 1;