Party games
Turn of Phrase
The spin-and-solve phrase puzzle. Spin the wheel, call letters, buy vowels and solve the phrase before anyone else; three rounds, then the final puzzle.
On this page
Turn of Phrase is a phrase puzzle for two to eight seats, bots welcome. A phrase hides on a board of tiles under its category. On your turn you spin the wheel and call a consonant (the wedge’s points for each tile it fills), buy a vowel for 250 of this round’s points, or solve. The first to solve a round banks its points; everyone else’s points for the round are gone. Each round opens with a quick puzzle whose letters turn over by themselves, and after three rounds the leader plays the final puzzle.
It plays the classic TV format with our own name, look, phrases and names for its moments. David’s calls of 2026-11-09 are in docs/turn-of-phrase.md. It’s a table game on the table service. Its quick puzzles judge who pressed first the way Good Question’s buzzer does, with the same code (tables/buzzer.py, ADR 0089). Where the wheel lands is the server’s, and a solve is exact (ADR 0091).
At a glance#
| Part | Where |
|---|---|
| Rules: quick puzzles, the wheel, letters, solving, rounds, the final puzzle | tables/turn_of_phrase/rules.py |
| Bots | tables/turn_of_phrase/bots.py |
| The phrase bank and dealing a game from it | tables/turn_of_phrase/library.py |
| Who pressed first (shared with Good Question) | tables/buzzer.py |
| The table: the wheel, the board, the rack, the seats, the dock | games/static/games/turn-of-phrase/table.js |
| The entry: the lobby’s settings | games/static/games/turn-of-phrase/app.js |
| Its look: tokens, tiles and keys; the table | games/static/games/turn-of-phrase/turn-of-phrase.css, games/static/games/turn-of-phrase/table.css |
| How to play | games/rulebooks/turn-of-phrase.md |
| Tests | tests/test_turn_of_phrase.py, tools/room/turn-of-phrase.test.mjs |
| The bank’s check | tools/turn-of-phrase/phrases.py |
| A table set to a moment | tools/turn-of-phrase/stage.py |
| Rules and design notes | docs/turn-of-phrase.md |
The phrase bank#
A phrase has its category, its words and its use (a round, a quick puzzle or the final), kept in TOML files under tables/turn_of_phrase/phrases/: 600 of them, 450 for rounds, 90 quick puzzles and 60 finals. The board is four rows of twelve on every screen, so the loader refuses a phrase that won’t wrap into four rows with its words unbroken, a quick puzzle over two rows, and a final with a one-letter word (every word gives its first consonant):
tables/turn_of_phrase/library.py layout · lines 44–55def layout(text: str) -> list[str] | None:
"""The phrase's rows on the board, words unbroken, or None if it
doesn't fit four rows of twelve."""
rows: list[str] = []
for w in words(text):
if len(w) > COLS:
return None
if rows and len(rows[-1]) + 1 + len(w) <= COLS:
rows[-1] += " " + w
else:
rows.append(w)
return rows if 0 < len(rows) <= ROWS else None
A game is dealt three round puzzles, three quick puzzles and a final. None comes back at a table until its kind runs out: what’s been played is carried from game to game (_carry, read back as settings["_before"]).
The rules in code#
The state#
Everything a game needs is in its JSON state: the deal, the board being played (its words, kept in the state, and the letters called), each seat’s banked points (totals) and this round’s (rnd), whose turn it is, the spin, and the quick puzzle or the final when one is on. The phase moves the game along. turn and call wait on their player; every other phase has a clock. tick takes each step that’s due:
tables/turn_of_phrase/rules.py _step · lines 701–746def _step(state: dict, now: float) -> bool:
"""One thing that's due, done. True if anything was."""
due = _due(state)
if due is None or now < due:
return False
phase = state["phase"]
if phase == "quick_intro":
_quick_go(state, now)
elif phase == "quick":
if state["quick"]["presses"]:
_decide_stop(state, now)
else:
_quick_turn(state, now)
elif phase == "quick_solve":
_quick_sent(state, state["quick"]["stopper"], "", False, now)
elif phase == "quick_end":
_start_round(state, now)
elif phase == "spin":
_landed(state, now)
elif phase == "landed":
_to(state, "call", None)
elif phase == "round_intro":
_to(state, "turn", None)
elif phase == "beat":
state["turn"] = state["after"]
state["after"] = None
_to(state, "turn", None)
elif phase == "solve":
_round_sent(state, state["solving"]["seat"], "", False, now)
elif phase == "solved":
_round_over(state)
elif phase == "final_intro":
state["final"]["from"] = None
_to(state, "final_pick", now + FINAL_PICK_SECS)
elif phase == "final_pick":
_final_turn(state, now)
elif phase == "final_turn":
state["final"]["from"] = round(now, 3)
_to(state, "final_solve", now + FINAL_SOLVE + LATE)
elif phase == "final_solve":
_final_reveal(state, now)
elif phase == "final_reveal":
_finish(state, "done", now)
else:
return False
return True
The wheel#
The wheel has 24 wedges: twenty points wedges from 300 to 900, a top wedge that rises by round, two Bust and one Lose a turn (call 3):
tables/turn_of_phrase/rules.py WHEEL · lines 54–57# The wheel, clockwise from the top wedge (call 3): twenty points wedges
# from 300 to 900, the top wedge, two Bust and one Lose a turn.
WHEEL = ("top", 600, 400, 700, "bust", 900, 500, 650, 350, 800, 550, "lose",
300, 750, 500, 900, "bust", 450, 600, 850, 400, 700, 500, 800)
A spin carries only the flick’s strength. The rules draw the wedge from the seed and the spin’s count, and set when it lands; every page plays the same spin to the same wedge (ADR 0091):
tables/turn_of_phrase/rules.py spin · lines 369–384def spin(state, seat, action, now):
"""Spin the wheel. A flick's `force` (0 to 1) sets how long it spins;
where it lands is the server's, drawn when the spin is made."""
_my_turn(state, seat)
if not _consonants_left(state):
raise Illegal("Every consonant is showing. Buy a vowel or solve.")
force = _number(action.get("force"), 0.0, 1.0, 0.5)
wedge = random.Random(f"{slug}:{state['seed']}:spin{state['spins']}").randrange(len(WHEEL))
state["spins"] += 1
w = WHEEL[wedge]
kind = "points" if isinstance(w, int) else w
value = TOP[state["round"]] if w == "top" else (w if isinstance(w, int) else 0)
lands = round(now + SPIN_MIN + force * (SPIN_MAX - SPIN_MIN), 3)
state["spin"] = {"seat": seat, "wedge": wedge, "kind": "points" if kind == "top" else kind, "top": w == "top",
"value": value, "at": round(now, 3), "lands": lands, "force": round(force, 2)}
_to(state, "spin", lands)
The wedge it lands on holds 1.2 seconds before the consonant is called, and the top wedge 3.2 seconds, long enough for its moment (playtest 2). On points, the player calls a consonant and scores the wedge for each tile; Bust takes this round’s points (the first at a table is flagged, so the screen can explain it); Lose a turn ends the turn. When every consonant in the phrase is showing, the wheel stops.
Letters and solving#
A consonant called scores; a vowel costs 250 of this round’s points whether it’s there or not. A letter already called can’t be picked (call 15). A miss passes the turn after a beat; a letter that’s there holds a beat while the tiles turn over, one by one.
A solve is filled in on the board’s blanks, letter for letter, in 30 seconds; spaces and punctuation are given, so there’s nothing to judge loosely. A bot says whether it knows the phrase, and the rules fill in its letters:
tables/turn_of_phrase/rules.py _fill · lines 197–204def _fill(state: dict, seat: int, action: dict, blanks: str) -> tuple[str, bool]:
"""What a seat filled in and whether it's right. A bot says whether it
knows the phrase (it never sees it), and the rules fill in what it says."""
if seat in state["bots"] and "recall" in action:
said = blanks if action["recall"] else _wrong_fill(blanks)
else:
said = _clean_fill(action)
return said, said == blanks
Right banks this round’s points, at least 1,000, and everyone else’s are gone; wrong passes the turn and costs nothing. What a wrong solve typed is kept secret until the round’s end.
Quick puzzles#
Before each round a short phrase’s letters turn over by themselves, one every 1.2 seconds. A press of Stop and solve carries its stamp, and the race is decided by tables/buzzer.py (the letters hold still while it is). The stopper has 15 seconds; right banks 1,000 and takes the round’s first turn, wrong sits out the rest of it.
Between rounds#
A round’s end is a ready: everyone says Next round (the host’s Deal says it for the rest, and someone away is readied by the service). The round’s card lists everyone by banked points: the seat’s mark, the name and what happened to them (Solved it, or this round’s points struck through, gone), what they gained, the total and Ready. On a phone (520px and under) a row is two lines, the name and the total, then the gain and Ready under them: on one line the name had about 10px and broke a letter or two a line (playtest 3, 2026-11-20). The game over’s standings had the same squeeze from a phone rule meant for the seats’ names in the strip (.tpnm’s column and size), now held to .tpseat.
The final puzzle#
The leader, or every seat tied for the lead, plays it. One letter in each word turns over (its first consonant), then each finalist picks three consonants and a vowel, kept secret until they turn over:
tables/turn_of_phrase/rules.py _given · lines 551–563def _given(text: str) -> list[int]:
"""One letter in each word: its first consonant (call 6)."""
out, i = [], 0
for word in text.split():
found = None
for c in word:
if c.isalpha():
if found is None and c in CONSONANTS:
found = i
i += 1
if found is not None:
out.append(found)
return out
Thirty seconds to solve, for a 5,000 bonus. Everyone else plays along on the first finalist’s board, for nothing but the reveal’s “had it too”.
What each seat sees#
view(state, seat) keeps secret the phrase’s hidden letters, the order a quick puzzle’s letters will turn in, where the next spin lands (it’s the seed’s), the phrases still to come, what a wrong solve typed until the round’s end, a finalist’s picks until they turn over, and everyone’s final guess until the reveal. The contract test’s scramble changes each of those (a hidden consonant for a consonant, a vowel for a vowel, so “every consonant is showing” doesn’t move) and checks no seat’s view moves.
The bots#
A bot’s level is when it knows a phrase (the share of letters showing), which letters it calls and when it buys:
tables/turn_of_phrase/bots.py KNOWS · line 18KNOWS = {"easy": 0.85, "medium": 0.70, "hard": 0.50} # a round's or the final's puzzle
Easy calls at random; Medium calls the commonest letters first; Hard reads each word’s blanks against every word in the bank (the same for every table, so it tells it nothing about which phrase this is) and calls the letter that fits most. A bot that tries a solve without knowing is right only by luck. In a quick puzzle a bot stops the board a reaction time after the letter it needed:
tables/turn_of_phrase/bots.py REACT · line 21REACT = {"easy": (1.0, 2.2), "medium": (0.6, 1.3), "hard": (0.35, 0.8)} # seconds after the letter turns
The numbers are a first guess, to be tuned by measuring, as the other games’ bots were.
The interface#
games/static/games/turn-of-phrase/table.js draws the table on the room kit in direction A, the midway stage, David’s pick after the first playtest. On a laptop the seats are a scoreboard down the left; the board is in the middle, with the wheel’s top half rising under it like a stage floor; the turn card and the letter rack are in a rail on the right. On a phone the seats are a strip at the top (two rows of four at eight), then the board, then the wheel’s arc or the rack, whichever the turn needs. Sizes come from the width first: fit() gives the board’s tiles the middle column’s width (and no more of its height than leaves the wheel room to rise), then the wheel what’s left:
games/static/games/turn-of-phrase/table.js TurnOfPhraseTable./** Sizes from the width first: the board's tiles take the middle column's
* width (and no more of its height than leaves the wheel room to rise),
* then the wheel takes what's left under the board. */
fit() {
const c = this.el.play;
const w = c.clientWidth || 0, hgt = c.clientHeight || 0;
if (!w || !hgt) return;
const phone = this.phone;
const gap = phone ? 3 : 5, pad = phone ? 8 + 4 : 16 + 8; // the frame's padding, the board's
const catH = (this.el.cat.offsetHeight || 34) + (phone ? 8 : 14);
const byWidth = (w - 2 * pad - 11 * gap) / 12;
const byHeight = ((hgt - catH) * (phone ? 0.5 : 0.56) - 2 * pad - 3 * gap) / (4 * 1.18);
const tile = Math.max(phone ? 18 : 22, Math.min(byWidth, byHeight, phone ? 30 : 58));
const boardH = 4 * tile * 1.18 + 3 * gap + 2 * pad;
const left = Math.max(80, hgt - catH - boardH - (phone ? 8 : 14));
// The wheel rises under the board: on a laptop its top part (the flapper,
// the values), as much as there's room for; on a phone, as much of it as fits.
const wheel = Math.max(160, Math.min(w * (phone ? 0.92 : 0.86), left / 0.45, phone ? 380 : 640));
this.felt.style.setProperty('--tile', `${Math.floor(tile)}px`);
this.felt.style.setProperty('--wheel', `${Math.floor(wheel)}px`);
this.felt.style.setProperty('--arc', `${Math.floor(Math.min(left, wheel * (phone ? 1 : 0.62)))}px`);
}
The wheel plays the server’s spin: clockwise, slowing, the pegs knocking the flapper. A drag on it is a flick, its speed the spin’s force; the Spin button (the space bar on a laptop) is always there too. The wedge it landed on lights while the turn plays out.
The big moments are staged, a held beat each, as the rules hold them (David’s rule: “slowing down for the important moments and visually communicating everything clearly”). A spotlight dims the table round the part that matters (the wheel while it spins and lands, the board while letters turn or someone solves); a ribbon card in the fair’s paint carries a round’s start, a quick puzzle, the top wedge (gold, under a string of pennants that drop in one by one: “2,500 a letter”), a Bust or a lost turn, a solve and the final puzzle; any press puts it away. A solve sets the board’s bulbs chasing round its frame, clockwise: every third bulb lit, along the top, down the right side, back along the bottom and up the left. The frame’s bulbs are a row along each edge, their spacing worked out from the frame’s size so a whole number fits each side and the rows meet at the corners. A letter called goes up big over the board, then its tiles light (the first with the count) and turn over one at a time, each one’s points rising off it:
games/static/games/turn-of-phrase/table.js TurnOfPhraseTable./** Where tile k of a reveal is, at ms into it. */
tileBeat(rv, k, ms) {
if (rv.kind === 'quick') return { cls: 'shown' };
if (rv.kind === 'wave') return { cls: ms < k * 60 + 420 ? 'fresh' : 'shown', delay: k * 60 - ms };
const lit = CALLED_MS, flip = CALLED_MS + LIT_MS + k * TURN_MS;
if (ms < lit) return { cls: 'blank' };
if (ms < flip) return { cls: 'lit', badge: k === 0 && rv.count > 1 };
if (ms < flip + 420) return { cls: 'fresh', delay: flip - ms };
return { cls: 'shown' };
}
The dock says what’s yours to do, in words (in a quick puzzle, a wide Stop and solve, the space bar on a laptop: its own class, tpstop, since the called letter’s tpbig is set absolute and half off its place, which once put the button off the screen), with Spin, Buy a vowel and Solve always in the same places (dashed when they can’t be pressed). While you wait, its second line says how soon you’re up. The space bar (Spin, and Stop and solve) is in the table’s always keys, so it works whatever Shortcut keys says, except while you type in a field or when a button you reached with Tab has the focus (Space presses that button); in the single-key list it was never heard, though both buttons showed its cap (2026-11-21). Filling in a solve puts the cursor on the first blank and moves it as you type, on a laptop’s keys or a phone’s keyboard; a press on a blank moves the cursor there.
The game’s Options add Sounds (off at first, David’s call): the wheel ticking as it slows, and the tiles turning over.
Its look#
The personality sheet (families): a county fair, David’s pick of 2026-11-09. A party game’s own look on the room kit.
- The ground: dark stained wood, the room’s.
- The wheel: a painted wooden prize wheel on a booth, barn red, mustard, teal and cream, with brass pegs, a brass hub and a leather flapper. The top wedge is gold foil; Bust is near-black.
- The board: hand-painted cream tiles on teal, in a barn-red frame of round bulbs that chase round it when it’s solved. A tile about to turn over glows teal.
- The rack: cream keys; a called letter is crossed out, a letter you can’t pick now is dashed, never faded; a pick is a tint, an inner ring and bold.
- The accent: barn red, the primary button’s fill. The turn color, the room’s bulb yellow, only ever a ring or outline, with its glow inside the edge (inset since the details check, 2026-11-21) (your seat, the cursor’s tile, the dock when it’s yours).
- The win: the house’s celebration in the fair’s paint, behind the result sheet: the room’s, so once a game, and a rating high’s
bestwhen you didn’t win. - Faces (OFL, bundled): Alfa Slab One, a sign painter’s slab, for headings, the wheel’s values and the board’s letters, and Figtree for everything else you read or press.
- Ribbon cards: cream with a red band across the top; gold with a rosette for a solve and the final’s reveal; a dark band for a Bust or a lost turn.
- Panels on the stage are solid, so the board never shows through words.
Trophy Case#
Its secret trophy in the Trophy Case, Early read, waits with it until it’s listed: a quick puzzle solved with half its letters or more still face down. result() keeps each seat’s count of those (early_reads), with its stats. Clean final, the final with no wrong letter, was left out: the research estimated it at 5–10% of games. Counts only, never chat or words typed (ADR 0095).
Rating#
A kept game is rated with the other table games on the shared hooks (Ratings): places by banked points, ties sharing. Its bots’ fixed ratings are the default spacing until they’re measured (ratings/tables.py).
Testing#
tests/test_turn_of_phrase.py says the rules as sentences: the deal and no Short setting; quick puzzles, the earliest tap stopping the board though it arrived second, and the board holding still while a race is decided; a consonant’s points per tile, a miss, a letter already called, the top wedge rising by round, Bust keeping what’s banked, Lose a turn, vowels at 250, the wheel stopping when every consonant shows, the server’s landing and the flick’s length; solving, its clock and Cancel; the round’s ready; the final’s given letters, secret picks, bonus and a tie broken by a lone solve; the bank’s fit and closeness rules; and bots playing whole games, the harder ones banking more. It also runs the contract every table game meets (TableGameContract). tools/room/turn-of-phrase.test.mjs draws every moment for the player, another player and a spectator under Node, and holds the dock’s words to the doc’s. npm run check:turn-of-phrase:phrases holds the bank to its rules (Testing); tools/turn-of-phrase/stage.py sets a table to a moment (your turn, your next spin landing on the top wedge, a solve and its lights, a late round three with five-figure points on eight seats, the round’s card with a solver and two seats’ points gone (scored), a solve being filled in, a quick puzzle, the final’s picks) for the details check and for playtests.