Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ a new game or a change keeps to them.
never selects another board; a double tap brings one in; a tap on the board you are on is
the game's. A long press does nothing to the bottom row (Nov 22; Minesweeper keeps its flag): the dots open it, its × shuts it.
A double click on the board you are on shows it full screen and playable, alone (Dec 1, `focusOpen`, `docs/field.md`); a double click or
Escape goes back. An app that takes the double itself keeps it; the labs show theirs in their own view (`soloOnDouble`).
Escape goes back. Every game does the same; a game takes the double click for itself (`noDoubleTap`) only for a very good reason
(Dec 1: real-time play where two quick taps on one spot are two moves, as Simon, Whack-a-mole, Blockout, pinball, Pong; or an editor),
never because its taps can come fast at the player's own pace. The labs show theirs in their own view (`soloOnDouble`). No full screen button.
- **Games play with the row shut.** The row never opens by itself; what a gesture cannot do
goes on the play pad (`playActs`). An editor's row is opened by its ✎ or menu item.
Small tools always at hand (a palette, undo) go on the tool bar (`toolTiles`, `onToolTap`, Nov 26): icons only, chips in the
Expand Down
13 changes: 13 additions & 0 deletions docs/field.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,3 +854,16 @@ Four of smoke part 1's checks had been failing since the Nov 28 changes, on `mai
Also measured the same day (part 4 failing under load after the full screen's change, passing alone): blockout's and Soma's frames over 20 s,
today's page against the one before the day's changes, two rounds each: blockout 2.4 against 3.0–3.6 s a frame in the software renderer,
Soma 73–75 against 119–147 ms. No frame is slower; the failures under load were the load's.
- **The double click is full screen in every game** (1 Dec 2026, the same evening: "remove the full screen icons from all games. every game
should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it
needs to be a very good reason."). The ⛶ chip is gone. Of the 22 games that kept the double click (`noDoubleTap`), the nine played at their
own pace gave it up, since a second tap a moment later is still a tap there: Lights Out, Sudoku, Nonograms, Hashi, Bejeweled, the block
builder, the flash cards, the tanks, and Soma's play. Those keeping it, each for a very good reason: real-time play where two quick taps on one
spot are two moves (Blockout's spins, Simon's pad pressed twice running in its timed sequence, Whack-a-mole's whacks, pinball's flippers,
Pong's, air hockey's and squash's paddles, Board War's two shots, marble run's tiles turned as the marble rolls); trick shots, whose view stands
behind the white and is never the board's own place; the game lab; and the editors (Soma's editor and gallery, the tiles', the tilt maze's,
pinball's). Part 5's check: Sudoku with a puzzle under way, a real double click full screen and no ⛶ anywhere, Escape back; Simon keeps its.
The checks that tapped those games quickly on one square (Lights Out's five presses, Nonograms', Sudoku's and Hashi's four) now tap at a
player's pace, past a double's 400 ms, and check the board did not go full screen; Sudoku's and Hashi's also wait past the check before's last
click, which landed on the same square 160 ms earlier and made a true double. Part 7's "double tap off default" now has Lights Out giving the
double click up. Each touch tap reaches the field once (checked: no tap is read twice by its pointer and touch events).
35 changes: 13 additions & 22 deletions games.html
Original file line number Diff line number Diff line change
Expand Up @@ -14036,17 +14036,9 @@
if (L && L.length){ _toolBarLast = { app: a, L }; }
else if (_toolBarLast && _toolBarLast.app === a) L = _toolBarLast.L.map(q => ({ ...q, on: false, dim: true, idle: true }));
else _toolBarLast = null;
/* A FULL SCREEN CHIP, WHERE THE DOUBLE CLICK IS THE GAME'S (Dec 1, "What's next", then "1 3": "A full-screen button … for games that keep the
double click for themselves"). A game that takes the double click for its own play (`noDoubleTap()` saying so now, as Sudoku, Simon,
Lights Out and Whack-a-mole do while a board is in play, or an editor while it is open; or `onDoubleTap`) cannot reach THE BOARD YOU ARE ON, FULL SCREEN by it, so the field puts one
chip of its own at the end of the game's ring: ⛶, pressed (draw's gold) while the board is full screen; a press goes in or comes back. It is
the field's, not the game's (`field`), so the game's own chips keep their numbers. The labs, with their own view, and the games whose double
click is the field's have none. */
let _dblGame = false; try { _dblGame = !!(a && (a.onDoubleTap || (a.noDoubleTap && a.noDoubleTap()))); } catch {}
// (shown while the double click is the game's now, and while the board is full screen, so there is always a way back)
if (a && f && !a.soloOnDouble && (_dblGame || FOCUS.on)){
L = (L || []).concat([{ glyph: '⛶', title: FOCUS.on ? 'Leave full screen' : 'This board full screen', on: FOCUS.on, field: 'focus' }]); }
const sig = L && L.length ? L.map(q => q.glyph + '|' + (q.title || '') + (q.on ? '+' : '') + (q.dim ? '-' : '') + (q.idle ? '~' : '') + (q.field || '')).join(',') : '';
/* (A FULL SCREEN CHIP for games that kept the double click, Dec 1, went the same day: "remove the full screen icons from all games. every game
should do handle double click the same by going to full screen." The games that kept it for no very good reason gave it up instead.) */
const sig = L && L.length ? L.map(q => q.glyph + '|' + (q.title || '') + (q.on ? '+' : '') + (q.dim ? '-' : '') + (q.idle ? '~' : '')).join(',') : '';
if (sig === _toolBarSig) return;
_toolBarSig = sig;
const ring = document.getElementById('gameBar'); if (!ring) return;
Expand All @@ -14057,13 +14049,12 @@
L.forEach((q, i) => { const b = document.createElement('button'); b.type = 'button'; b.className = 'panel chip tchip'; b.dataset.i = i;
b.addEventListener('click', e => { e.stopPropagation();
if (b.dataset.idle === '1') return; // (a button kept while its game gives none: nothing to do)
if (b.dataset.field === 'focus'){ if (FOCUS.on) focusClose(); else focusOpen(); _toolBarSig = null; try { toolBarTick(window.getFieldApp && window.getFieldApp()); } catch {} try { restWake(); } catch {} return; }
try { const a2 = window.getFieldApp && window.getFieldApp(), f2 = bbFramedCell(); if (a2 && a2.onToolTap && f2) a2.onToolTap(f2.c, f2.r, +b.dataset.i); }
catch (err){ _reportError('tool bar', err); }
_toolBarSig = null; try { toolBarTick(window.getFieldApp && window.getFieldApp()); } catch {} try { restWake(); } catch {} });
ring.appendChild(b); old.push(b); }); }
L.forEach((q, i) => { const b = old[i]; b.textContent = q.glyph; b.title = q.title || ''; b.setAttribute('aria-label', b.title);
b.setAttribute('aria-pressed', q.on ? 'true' : 'false'); b.classList.toggle('dim', !!q.dim); b.dataset.idle = q.idle ? '1' : ''; b.dataset.field = q.field || ''; });
b.setAttribute('aria-pressed', q.on ? 'true' : 'false'); b.classList.toggle('dim', !!q.dim); b.dataset.idle = q.idle ? '1' : ''; });
try { window.__gameRing && window.__gameRing.layout(); } catch {}
}
let _bbQuickSig = null;
Expand Down Expand Up @@ -34053,7 +34044,7 @@
onReset(c, r){ if (DEMO && DEMO.c === c && DEMO.r === r) DEMO = null; if (GAL.on && GAL.c === c && GAL.r === r) GAL.on = false; GAMES.set(gkey(c, r), fresh(c, r)); LIVE = { c, r }; touched(); return true; },
onSelect(c, r){ return true; },
onFramed(c, r){ LIVE = c == null ? null : { c, r }; if (c != null){ const g = gameAt(c, r); countSoon(g.F); } },
noDoubleTap(){ return ED.on || GAL.on ? 'always' : !!liveGame(); },
noDoubleTap(){ return ED.on || GAL.on ? 'always' : false; }, // (its editor and gallery keep it; its play no longer does (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
// two fingers twisted turn the piece in hand about the upright, a quarter turn each TWIST_STEP degrees (the field's twist)
// (a twist begun on the piece in hand, or its shadow in the figure, turns the piece; any other turns the view, as in every other
// game: Oct 24, "two finger rotate does not work for some applications, such as soma.", when every twist took the piece)
Expand Down Expand Up @@ -34916,7 +34907,7 @@
onReset(c, r){ restart(c, r); return true; },
onSelect(c, r){ return true; },
onFramed(c, r){ LIVE = (c == null) ? null : { key: gkey(c, r), c, r }; },
noDoubleTap(){ const g = liveGame(); return !!(g && g.state === 'play'); },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
statTiles(c, r){ return tilesOf(c, r); },
onStatTap(c, r, i){
if (i === 0){ restart(c, r); return true; }
Expand Down Expand Up @@ -53978,7 +53969,7 @@
/* (Oct 15, Simon's lesson: "the simon buttons are very hard to push".) Two quick presses on one square are an ordinary
thing here (pressed by mistake, pressed back), and the field read the second as a double-tap, which reframes the view
and never reaches the game. While the framed board is not yet out, every tap is a press. */
noDoubleTap(){ const g = liveGame(); return !!g && !g.done; },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
onCellTap(c, r, u, v){
LIVE = { c, r };
const g = gameAt(c, r);
Expand Down Expand Up @@ -54150,7 +54141,7 @@
onReset(c, r){ GAMES.set(gkey(c, r), fresh(c, r)); LIVE = { c, r }; return true; },
onSelect(c, r){ return true; },
onFramed(c, r){ LIVE = c == null ? null : { c, r }; },
noDoubleTap(){ const g = liveGame(); return !!g && !g.done; },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
onCellTap(c, r, u, v){
LIVE = { c, r };
const g = gameAt(c, r);
Expand Down Expand Up @@ -54901,7 +54892,7 @@
/* (Oct 15, Simon: "the simon buttons are very hard to push".) Two quick taps on one square, filling and clearing it, or
filling two squares side by side, read as a double-tap, which reframes the view and never reaches the game. While a
puzzle is on the framed board every tap is a tap. */
noDoubleTap(){ const g = liveGame(); return !!g && g.state !== 'solved'; },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
onCellTap(c, r, u, v){
// (the tap the field still calls at the end of a short drag: the drag has done what it meant, as in golf's editor)
if (DRAG && DRAG.moved){ DRAG = null; return true; }
Expand Down Expand Up @@ -55546,7 +55537,7 @@
/* (Oct 15, Simon: "the simon buttons are very hard to push".) A digit tapped twice in a row (put in, taken out) or two squares
tapped quickly read as a double-tap, which reframes the view and never reaches the game. While a puzzle is on the framed board
every tap is a tap. */
noDoubleTap(){ const g = liveGame(); return !!g && g.state !== 'solved'; },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
onCellTap(c, r, u, v){
const live = !!LIVE && LIVE.c === c && LIVE.r === r;
LIVE = { c, r };
Expand Down Expand Up @@ -56194,7 +56185,7 @@
onFramed(c, r){ LIVE = c == null ? null : { c, r }; },
/* (Oct 15, Simon: "the simon buttons are very hard to push".) Two quick taps on an island and the next, or on one pair twice, read as
a double-tap, which reframes the view and never reaches the game. While a puzzle is on the framed board every tap is a tap. */
noDoubleTap(){ const g = liveGame(); return !!g && g.state !== 'solved'; },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
onCellTap(c, r, u, v){
// (the tap the field still calls at the end of a short drag: the drag has done what it meant, as in Nonograms)
if (DRAG && DRAG.moved){ DRAG = null; return true; }
Expand Down Expand Up @@ -56704,7 +56695,7 @@
LIVE = c == null ? null : { c, r };
},
// (two quick taps on the framed card are a turn and a grade, never the field's double tap)
noDoubleTap(){ return !!LIVE; },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
onCellTap(c, r, u, v){
const was = LIVE && LIVE.c === c && LIVE.r === r;
LIVE = { c, r };
Expand Down Expand Up @@ -57836,7 +57827,7 @@
LIVE = c == null ? null : { c, r };
if (LIVE && !TOLD){ TOLD = true; say('Your tank is on the left. Tap or drag on the board to aim: the dots show where the shell goes. Tap your tank (or Enter) to fire. The buttons on the right choose a shell and drive. Arrows aim, A and D drive, 1–6 choose a shell.', 6000); }
},
noDoubleTap(){ const g = liveGame(); return !!g && g.state !== 'over'; },
// (no noDoubleTap any more (Dec 1: "every game should do handle double click the same by going to full screen. if there is a good reason a game needs to take control of double click,it needs to be a very good reason.": played at its own pace, a second tap a moment later is a tap, so the double click is the field's, the board full screen))
onCellTap(c, r, u, v){
if (performance.now() - ateAt < 400) return true; // (the tap the field still calls after a short drag)
LIVE = { c, r };
Expand Down
15 changes: 8 additions & 7 deletions tests/part4.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,8 +1309,9 @@ try {
const ok2 = real && real.moves === 3 && real.got.every(g => g.changed === g.want);
if (!ok2) failures.push('[lightsout] real clicks: ' + JSON.stringify({ fc, real }));
console.log(`${ok2 ? 'ok ' : 'FAIL'} lightsout: three real clicks flip the cross about each square clicked, corner and edge too`);
// five quick real touches on one square are five presses, each a flip (Simon's lesson: a quick second tap on one spot
// was read as a double-tap and never reached the game)
// five real touches on one square are five presses, each a flip (Simon's lesson; since Dec 1, "every game should do handle double click the
// same by going to full screen", Lights Out no longer keeps the double click, so the touches come at a player's own pace, past a double's
// 400 ms, and none opens the full screen)
await cdp.send('Emulation.setTouchEmulationEnabled', { enabled: true });
const quick = await page.evaluate(async () => {
const A = window.getFieldApp(), D = A._debug, W = window.FIELD_WORLD, f = W.cellAt(W.target.boardX, W.target.boardZ);
Expand All @@ -1322,12 +1323,12 @@ try {
const tap = async (u, v, after) => { const p = S(u, v); ptr('pointerdown', p); const t = mk(p); fire('touchstart', t); ptr('pointerup', p); fire('touchend', t); await wait(after); };
const g = D.fresh(f.c, f.r); D.GAMES.set(f.c + '_' + f.r, g); D.LIVE = { c: f.c, r: f.r };
const n = g.n, i = 1 * n + 1, start = g.S.start, seen = [];
for (let k = 0; k < 5; k++){ await tap((1 + 0.5) / n, (1 + 0.5) / n, 200); seen.push(g.L.some((v, j) => v !== start[j]) ? 1 : 0); }
for (let k = 0; k < 5; k++){ await tap((1 + 0.5) / n, (1 + 0.5) / n, 550); seen.push(g.L.some((v, j) => v !== start[j]) ? 1 : 0); }
const cross = D.crossOf(n, i), odd = Array.from(g.L).every((v, j) => v === (cross.includes(j) ? 1 - start[j] : start[j]));
return { moves: g.moves, seen: seen.join(''), odd, noDbl: A.noDoubleTap() };
return { moves: g.moves, seen: seen.join(''), odd, noDbl: !window.fieldFocus.on };
});
await cdp.send('Emulation.setTouchEmulationEnabled', { enabled: false });
const ok3 = quick.moves === 5 && quick.seen === '10101' && quick.odd;
const ok3 = quick.moves === 5 && quick.seen === '10101' && quick.odd && quick.noDbl;
if (!ok3) failures.push('[lightsout] quick taps on one square: ' + JSON.stringify(quick));
console.log(`${ok3 ? 'ok ' : 'FAIL'} lightsout: five quick real touches on one square are five presses (${quick.moves}), flipping it each time (${quick.seen})`);
// a board no one plays presses its own way out, one square at a time
Expand Down Expand Up @@ -2167,9 +2168,9 @@ try {
D.MODE = 'fill';
const g = D.fresh(f.c, f.r); D.GAMES.set(f.c + '_' + f.r, g); D.LIVE = { c: f.c, r: f.r };
const i = g.P.n + 1, [u, v] = D.centreOf(g.P, i), seen = [];
for (let k = 0; k < 4; k++){ await tap(u, v, 200); seen.push(g.cells[i]); }
for (let k = 0; k < 4; k++){ await tap(u, v, 550); seen.push(g.cells[i]); }
const f2 = W.cellAt(W.target.boardX, W.target.boardZ);
return { seen, still: !!f2 && f2.c === f.c && f2.r === f.r, noDbl: window.getFieldApp().noDoubleTap() };
return { seen, still: !!f2 && f2.c === f.c && f2.r === f.r, noDbl: !window.fieldFocus.on };
});
await cdp.send('Emulation.setTouchEmulationEnabled', { enabled: false });
const ok3 = quick.seen.join() === '1,0,1,0' && quick.still && quick.noDbl;
Expand Down
Loading