Joins follow the travel direction: the next piece goes right after the end (t67 phase 2b)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// Shared join grid: eight rows (UR/DR/DL/UL, left/right ends), nine columns.
|
||||
// Travel join grid: UR/DR/DL/UL, both ends, and all three neighbouring placements.
|
||||
// Screw H and V, then belt H; each tries the side, above/below, and E.
|
||||
// Self-contained, paused and empty. Use --zoom 4 --viewport 2100x1500 --no-light.
|
||||
money = 50000;
|
||||
for (let y = 40; y < 420; y++) for (let x = 100; x < 560; x++) {
|
||||
for (let y = 0; y < 460; y++) for (let x = 0; x < 600; x++) {
|
||||
const i = y * W + x;
|
||||
setCell(i, EMPTY, 20, 0); bgm[i] = 0;
|
||||
}
|
||||
for (let x = 100; x < 560; x++) surfY[x] = 420;
|
||||
for (let x = 0; x < 600; x++) surfY[x] = 420;
|
||||
window.JOIN_CASES = [];
|
||||
for (let row = 0; row < 8; row++) for (let col = 0; col < 9; col++) {
|
||||
const v = 4 + (row >> 1), end = row & 1, side = end ? 1 : -1;
|
||||
@@ -15,13 +15,14 @@ for (let row = 0; row < 8; row++) for (let col = 0; col < 9; col++) {
|
||||
const bx = 34 + col * 12, by = 24 + row * 10;
|
||||
const nx = bx + (spot === 1 ? 0 : side), ny = by + (spot === 0 ? 0 : dy);
|
||||
const code = belt ? BP_BELT : BP_SCREW;
|
||||
const straight = belt ? (side > 0 ? 1 : 0) : vertical ? (dy < 0 ? 0 : 2) : (side > 0 ? 1 : 3);
|
||||
const [tx, ty] = SCREW_DIRS[v];
|
||||
const straight = belt ? (tx > 0 ? 1 : 0) : vertical ? (ty < 0 ? 0 : 2) : (tx > 0 ? 1 : 3);
|
||||
const diagonalCode = belt ? (slope < 0 ? BP_BELT_UP : BP_BELT_DOWN) : BP_SCREW;
|
||||
const diagonalV = belt ? (SCREW_DIRS[v][0] > 0 ? 1 : 0) : v;
|
||||
for (let k = 0; k < 2; k++) placeBlock(diagonalCode, diagonalV, bx - k * side, by - k * dy, true);
|
||||
for (let k = 0; k < 2; k++) placeBlock(code, straight, nx + (vertical ? 0 : k * side * (spot === 1 ? -1 : 1)), ny + (vertical ? k * dy * (spot === 0 ? -1 : 1) : 0), true);
|
||||
const joined = endJoin(bx, by, end) >= 0;
|
||||
const kind = joined ? (ny === by ? (end ? 2 : 4) : vertical ? 6 : 5) : 0;
|
||||
const kind = joined ? (ny === by ? (end ? 2 : 4) : nx === bx ? (ny < by ? 1 : 3) : vertical ? 6 : 5) : 0;
|
||||
JOIN_CASES.push({v, end, bx, by, nx, ny, vertical, code, straight, joined, kind, spot});
|
||||
}
|
||||
updateRoof();
|
||||
@@ -34,7 +35,7 @@ drawBot = () => {
|
||||
const p = worldToScreenPx(j.bx * BS - 8, j.by * BS - 14);
|
||||
ctx.fillStyle = '#17222c';
|
||||
const name = ['UR', 'DR', 'DL', 'UL'][j.v - 4], axis = j.code === BP_BELT ? 'belt' : j.vertical ? 'V' : 'H';
|
||||
ctx.fillText(`${name} ${j.end ? 'R' : 'L'} ${axis} ${['side', 'up/down', 'E'][j.spot]}: ${j.joined ? 'JOIN' : 'free'}`, p.x, p.y);
|
||||
ctx.fillText(`${name} ${['↗','↘','↙','↖'][j.v-4]} ${j.end ? 'R' : 'L'} ${axis} ${j.vertical ? (SCREW_DIRS[j.v][1]<0?'↑':'↓') : (SCREW_DIRS[j.v][0]>0?'→':'←')} ${['row', 'axis', 'diag'][j.spot]}: ${j.joined ? 'JOIN' : 'free'}`, p.x, p.y);
|
||||
}
|
||||
ctx.restore();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user