The Doozer Brainlive from the knowledge bundle · v2.2.697 · 2026-10-29 10:59 ETall pages · one page

Winner stays (Doozer Games' 1-on-1 house rule), Four in a Row and Reversi

systems/winner-stays.md · System · doozer-games, winner-stays, four-in-a-row, reversi, framework, tv, phones, rematch

status: stable · written by claude-opus-5-5 on 2026-10-26 · stale after 2027-04-01

The reusable rule for any 1-on-1 game on a Doozer Games TV (champion, challenger, a line, rematch), kept apart from the game so the next 1-on-1 game is only its rules and its board. Four in a Row and Reversi are built on it.

Winner stays: Four in a Row and Reversi

v2.2.691 (Oct 26 2026); Reversi v2.2.692 (Oct 27). Jon: "a 1-on-1 game that lets the winner stay while a new challenger can join. If no challengers exist, the winner still stays and the loser may ask for a rematch. This model can apply to many games." The room and relay under it: Doozer Games rooms and relay; the menu and how a new game plugs in: Town Trivia and the Doozer Games menu.

The rule (assets/js/doozer-winner-stays.js, DZWinnerStays.start)

Building the next 1-on-1 game

A game gives the rule four functions and draws what it is told:


var ws = DZWinnerStays.start({room, rules: {name, newState(), legal(s, move, side), autoMove(s, side),
  moves(s, side) /* optional: the phone on turn gets its legal moves */,
  apply(s, move, side) -> null                       // the other side moves next
                        | {next: 0|1, note}           // that side moves next: a pass, an extra turn
                        | {winner: 0|1|null, line, score}},   // over; null is a draw
  turnSecs, onView});
// DZRoom.start({welcome: p => { ws.enlist(p); return ws.phoneView(p); },
//               onJoin: ws.joined, onPart: ws.parted, onMsg: (p, m) => ws.msg(p, m)})

Four in a Row (includes/doozer-four-tv.php, /tv/four)

Seven columns, six rows; four across, down or diagonally wins. The TV draws an SVG board (wood frame, stones that drop, the winning four pulsing), champion and challenger cards with a turn timer bar, a banner for the matchup and the result, "Next up" with the line, and plays itself (an attract loop) until two people are in. The code card is a small corner chip during a game and stands in the challenger's place when the seat is open, so it never covers the board. The rematch screen keeps the finished board. autoMove wins if it can, blocks if it must, else leans to the middle. The move is a column: the stone it dropped is the top one in that column (topCell), which the drop animation and the phone's last-move ring use.

The remote plays too: the first press gets it in line, arrows choose a column, OK drops (or asks for the rematch). Up to eight people in the room.

Reversi (includes/doozer-reversi-tv.php, /tv/reversi)

Chosen for a bar or living-room TV (Jon asked for one that suits the room): two colors and a big count beside each name tell anyone across the room who is ahead; one move can flip a whole row, so the lead swings in front of everyone; the phone lights up the squares you can play, so nobody needs the rules. It is the 1880s game, public domain; never call it Othello (a trademark).

8x8; the challenger (seat 1) has the classic opening squares and moves first. A move is a square (0 to 63). The stones a move traps turn over in a ripple out from it (a CSS scaleX flip; the color changes on edge); faint dots on the TV show where the player on turn can go, so the room can follow. A player with no move passes: apply returns {next: side, note: 'pass'}, the TV says "Wren has no move / Heron goes again", the phones say it too. When neither can move, the most stones wins and the result carries score ("Heron wins, 42 to 22"); 32 to 32 is a draw (the champion stays). autoMove picks by a corners-first weight table. The remote moves a cursor in two dimensions; it starts each turn on the legal square nearest where it was, and OK on an illegal square shakes it. About 1 game in 3 has a pass; 6 in 200 random games were draws.

GOTCHA (found on the Fire TV stick, v2.2.694): a stone keeps its pop-in class (put) after it lands, and when the flip class came off at the end of a flip, the pop-in started over: every stone placed during the game blinked out and popped back after flipping (41 of 41 measured). A flip now removes put too. With CSS animations, taking a class off can restart another one still on.

Looked at and dropped: dimming the loser's stones at the end turned gold into a muddy olive that read as a third player. The glowing winner card and the banner say who won; the board stays as played.

Testing

ws.test.mjs (24 checks, the rule with Four's rules, fake room), rev.test.mjs (13 checks and 200 whole Reversi games: counts always add up, passes only when the other side truly has no move) and headless-Chrome runs: three phones through the menu into a match, a new champion and the next challenger; two phones through a rematch, a mid-game leave and the remote as challenger; a whole Reversi game of 60 moves by tapping glowing squares; a replayed game that forces a pass; the remote's cursor. GOTCHAS:

On the Fire TV stick (Oct 27 2026, app 0.3.1, web 2.2.694): real remote presses over adb, the stick's own page read over DevTools, two or three headless phones on the live relay. Both games from the menu with the remote and the room code kept; Reversi flips at 58 to 59 fps (worst frame gap 34 ms) with the ripple timed as written; the remote cursor moves in two dimensions, starts on a legal square, shakes on an occupied one, places on a legal one; Four's hover column moves and OK drops; Back from either game lands on the menu, stays there, and the phones follow. That run found two bugs, both fixed: the backlog replay (the relay, v2.2.693) and the flip blink above. How: the release build hides the page from DevTools, so swap in the debug build (same source; uninstall first, the signatures differ) and put the release back after; adb shell input keyevent takes about 1.3 s a press, so a remote turn of ten presses uses half its 20 seconds; adb shell screenrecord plus ffmpeg frames shows an animation as the stick drew it.

Related: Doozer Games and Doozer Shop.

← What a directory page costs (and how to measure it)event-feeds →