Inline the one-line beltLike wrapper (t85)

Written by the local model (qwen3-coder-30b) in a sandboxed worktree via local-run; reviewed by Claude.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 18:41:36 -04:00
co-authored by Claude Opus 5.5
parent 0b624fe0b4
commit b5d7d457ca
3 changed files with 4 additions and 8 deletions
+1 -1
View File
@@ -173,7 +173,7 @@ function cellPixel(x, y) {
} else if (ly === 3) { // the belt's return run carries on under it, so belts and filters read as one belt
const st = ((x - dir * (anim >> 1)) >> 1) & 1;
if (m === EMPTY || st) { r = (st ? 92 : 56) * 0.72; g = (st ? 96 : 58) * 0.72; b = (st ? 104 : 66) * 0.72; }
} else if ((lx === 0 && !beltLike(fb, 0)) || (lx === 3 && !beltLike(fb, 1))) { if (m === EMPTY || ((x + y) & 1)) { r = 64; g = 66; b = 74; } } // frame only where the line ends
} else if ((lx === 0 && endJoin(fb % BW, (fb / BW) | 0, 0) < 0) || (lx === 3 && endJoin(fb % BW, (fb / BW) | 0, 1) < 0)) { if (m === EMPTY || ((x + y) & 1)) { r = 64; g = 66; b = 74; } } // frame only where the line ends
else if (m === EMPTY) { // mesh holes, tinted with what falls through them
if ((x + y) & 1) { r = 40; g = 42; b = 48; }
else if (inv) { r = 58; g = 74; b = 72; } // carry mode: everything else drops
-2
View File
@@ -116,8 +116,6 @@ function thinPipeColor(x, y, anim) {
}
PC[0] = r; PC[1] = g; PC[2] = bl;
}
// A filter frame opens only where this end has a geometric partner.
function beltLike(b, end) { return endJoin(b % BW, (b / BW) | 0, end) >= 0; }
// standing trees: the trunk shows its dark bark, so it reads apart from the pale cut wood it drops
const TREE_R = new Uint8Array(NMAT), TREE_G = new Uint8Array(NMAT), TREE_B = new Uint8Array(NMAT);
for (let m = 0; m < NMAT; m++) { TREE_R[m] = COLR[m]; TREE_G[m] = COLG[m]; TREE_B[m] = COLB[m]; }
+3 -5
View File
@@ -102,14 +102,12 @@ check('equal-shape inlet ties use top to bottom then left to right',run(`(()=>{
})()`));
const fs=require('fs');
run(fs.readFileSync('src/render/slope-belts.js','utf8'));
const setup=fs.readFileSync('src/render/setup.js','utf8');
run(setup.slice(setup.indexOf('function beltLike('),setup.indexOf('\n',setup.indexOf('function beltLike('))));
check('filter frames open at an uphill low-end feed and compatible screws',run(`(()=>{
blockP.fill(0);blockV.fill(0);const b=10*BW+10;
blockP[b]=BP_FILTER;blockV[b]=255;blockP[b+1]=BP_BELT_UP;blockV[b+1]=1;
if(!beltLike(b,1))return false;
blockP[b+1]=BP_SCREW;blockV[b+1]=1;if(!beltLike(b,1))return false;
blockV[b+1]=3;return !beltLike(b,1);
if(endJoin(b%BW,(b/BW)|0,1)<0)return false;
blockP[b+1]=BP_SCREW;blockV[b+1]=1;if(endJoin(b%BW,(b/BW)|0,1)<0)return false;
blockV[b+1]=3;return endJoin(b%BW,(b/BW)|0,1)<0;
})()`));
check('planned flat caps and slope continuations use the shared ends',run(`(()=>{
blockP.fill(0);blockV.fill(0);const b=10*BW+10;