Board games
Triple Take
The pattern-card race. Spot three cards where every feature is all the same or all different, before anyone else does: alone against the clock, with bots, or with family.
On this page
Triple Take is a race to spot patterns in cards. Every card has four features (count, shape, color and fill), each in three kinds, and a trio is three cards where each feature is all the same or all different. Twelve cards are out at once; anyone may take a trio at any moment, and the first to reach the server gets it. There are no turns. It’s played alone (the whole deck against the clock), with bots, or with up to eight people.
It plays the classic pattern-card game with our own name, cards and look (David’s calls of 2026-11-08 are in docs/triple-take.md). It’s a table game on the table service, a room-kit table in the browser (the front end), and kept games with other players are rated (Ratings).
At a glance#
| Part | Where |
|---|---|
| Rules and bots: the cards, taking a trio, the race | tables/triple_take/rules.py |
| The table: cards, stages, the dock, the result | games/static/games/triple-take/table.js |
| The cards, drawn | games/static/games/triple-take/cards.js |
| The entry: the lobby’s settings | games/static/games/triple-take/app.js |
| Its look: tokens and the cards | games/static/games/triple-take/triple-take.css, games/static/games/triple-take/table.css |
| How to play | games/rulebooks/triple-take.md |
| Tests | tests/test_triple_take.py |
| A table set to a late moment | tools/triple-take/stage.py |
| Rules and design notes | docs/triple-take.md |
The cards#
A card is a number from 0 to 80, and its four features are that number’s digits in base 3. Three cards are a trio when each feature’s three digits add up to a multiple of 3: all the same (0+0+0, 1+1+1, 2+2+2) or all different (0+1+2).
tables/triple_take/rules.py is_trio · lines 72–73def is_trio(a: int, b: int, c: int) -> bool:
return len({a, b, c}) == 3 and all((x + y + z) % 3 == 0 for x, y, z in zip(features(a), features(b), features(c)))
So any two cards have exactly one third that makes a trio with them, and twenty-one cards always hold one (twenty can hold none). The browser draws a card from the same number (games/static/games/triple-take/cards.js). Its shapes, a spool, a banner and a pick (David’s pick of three sets, 2026-11-08), each sit in a 22 × 44 box and cover the same area (620 of its 968 units), so no shape stands out by how much ink it puts down. Its fills are solid, open and shaded: fine lines across the shape every 3 units, 1.1 wide, which still read as lighter than solid and fuller than open on the smallest card the table draws (62px wide on a 320 × 568 phone with fifteen out).
The rules in code#
The state#
new shuffles the 81 cards from the table’s seed, lays out 12 and keeps the rest as the deck. The state holds the layout (in its places), the deck, each seat’s pile and total, wrong trios and photo finishes, when each seat’s freeze ends, when the cards came out (out_at), and the phase: play, pause (no trio here, three more coming) or over.
Taking a trio#
The only move is take, three cards. It’s one of four things:
tables/triple_take/rules.py take · lines 163–191def take(state, seat, action, now):
"""A seat sends three cards: a trio taken, a photo finish, or a wrong trio."""
if state["phase"] == "over":
raise Illegal("The game's over.")
cards = _cards(action)
if now < state["frozen"][seat]:
left = max(1, round(state["frozen"][seat] - now))
raise Illegal(f"You can pick again in {left} second{'s' if left != 1 else ''}.")
on = state["layout"]
if not all(c in on for c in cards):
last = state["last_take"]
if (last and now - last["at"] <= PHOTO and set(cards) & set(last["cards"]) and is_trio(*cards)
and all(c in last["before"] for c in cards) and last["seat"] != seat):
by = round(now - last["at"], 2)
state["photo"][seat] += 1
log.event(state, "photo", to=[seat], seat=seat, by=by, taker=last["seat"], cards=cards)
return
raise Illegal("Someone else just took one of those cards.")
if state["phase"] == "pause":
raise Illegal("There's no trio in these cards. Three more are coming.")
if now < state["open_at"]:
raise Illegal("New cards are going out. Try again in a moment.")
if not is_trio(*cards):
state["frozen"][seat] = now + FREEZE
state["wrong"][seat] += 1
log.event(state, "wrong", to=[seat], seat=seat, cards=cards, until=state["frozen"][seat], why=what_broke(*cards))
log.event(state, "frozen", seat=seat, until=state["frozen"][seat])
return
_take(state, seat, sorted(cards, key=on.index), now)
- A trio, all on the table: it’s taken (
_take). Three new cards go into its places while twelve or fewer are out, and nothing else moves; with more out, the layout closes up. Claims open again 4 seconds later (open_at), once the trio’s stage has played everywhere and its three new cards have been dealt on screen. Until then the state’sbeatis on:decidingnames no one, so no bot looks, however brisk the table, anddeadlineisopen_at, whentickturns it off. - Not a trio: the seat is frozen for 3 seconds and loses nothing. Its finder hears which feature broke (
what_broke, a private line); everyone else sees only that it was a wrong trio. - A trio that’s just gone: if it shares a card with the trio taken in the last 2 seconds and was a trio on the cards as they were, it’s a photo finish, told to its finder privately with how much later it arrived.
- Anything else (cards long gone, a pause) is refused with a sentence.
The server’s clock decides who was first: the order moves arrive in, under the table’s row lock. No call button (David’s call).
No trio, and the end#
After every change, _check_layout looks for a trio. None, with cards in the deck: the phase pauses for 2 seconds (after any stage still playing), then tick deals 3 more. None, with the deck out: the game is over. A quick game ends at 10 trios. Most trios wins; ties share a place.
A trio that sat out at least 20 seconds, longer than any before it this game, carries sat on its line and stage (“That one sat there for 41 seconds”).
The engine’s contract#
terms calls a round a game; holds_up is always false, since nobody has to find anything and the table waits on no one. counts keeps only a game where some trio was taken. result gives each seat one score (its trios) and adds detail, kept with the result for the Trophy Case (W5-1):
tables/triple_take/rules.py result · lines 331–342def result(state: dict) -> dict:
out = rounds.result({"n": state["n"], "scores": [state["totals"]], "totals": state["totals"]})
last = next((e for e in reversed(state["events"]) if e["type"] == "trio" and e.get("last")), None)
longest = max((e for e in state["events"] if e["type"] == "trio" and "sat" in e), key=lambda e: e["sat"], default=None)
# What the Trophy Case will read later (W5-1): kept with the result.
out["detail"] = {
"seconds": round((state["finished"] or state["started"]) - state["started"], 1), "length": state["length"],
"wrong": list(state["wrong"]), "photo": list(state["photo"]),
"last": last["seat"] if last else None,
"longest": {"seat": longest["seat"], "sat": longest["sat"]} if longest else None,
}
return out
What each seat sees#
Everyone sees the layout, the piles, the totals, who’s frozen and the deck’s size, never its order. A wrong trio’s reason and a photo finish are private lines (to). A spectator sees what everyone sees.
The bots#
A bot is never wrong and never peeks at the deck. Each new layout it first takes in for a glance (2 seconds, times the table’s pace; the game’s first deal an opening, 6 seconds, so the first-time “Spot a trio” card plays out and people get the first look: a bot 3 seconds in cut the card to a second and took the first trio, playtest 3, David’s call 2026-11-20), then looks again every spot (1 second). Before its level’s floor (FLOOR: 13, 6 and 2 looks) it finds nothing, so no bot, and no table of them, takes a trio sooner than a person could; after it, each look finds a trio with its level’s chance, more when there are several to find:
tables/triple_take/rules.py bot_action · lines 313–323def bot_action(state, seat, level, rng):
"""A first glance at new cards never finds anything; after it, each look
finds a trio with the level's chance, more when there are several."""
v = view(state, seat)
found = trios(v["layout"])
if v["phase"] != "play" or v["looks"] < FLOOR.get(level, FLOOR["medium"]) or not found:
return {"type": "look"}
chance = SPOT.get(level, SPOT["medium"]) * min(1.6, max(0.6, len(found) / 2))
if rng.random() < chance:
return {"type": "take", "cards": rng.choice(found)}
return {"type": "look"}
So Easy finds one about 35 seconds after the cards change, Medium about 18 (about a person’s pace) and Hard about 7 (SPOT; test_bots_find_trios_at_a_persons_pace holds each in its band). They were 20, 10 and 5 until David’s playtest of 2026-11-22: “Even the medium bot is wayyy too fast for a normal human to keep up”, and three Medium bots together found a trio every few seconds. Now three Medium bots still wait out the floor, about 8 seconds. A look that finds nothing is a look move: it counts the bot’s looks but bumps no seq, so it never wakes a browser. Bots sit at fixed ratings, the default spacing written out in ANCHORS (ratings/tables.py) until they’re measured (Ratings).
Bots that look at the same moment take turns in the order deciding lists them, and the first to find a trio takes it. That order turns over with every look (a hash of the layout and the looks so far), so bots of one level race as equals whatever their seat. With seats in a fixed order, hard bots in seat 0 won 56 games in 60 (playtest 3, 2026-11-19).
The interface#
games/static/games/triple-take/table.js draws the cards on their pane, sized to fill its height as well as its width (fit: four columns of three on a laptop, a column more for each three past twelve; on a phone two columns or three, whichever makes the bigger card, which is two of six rows for twelve, so the cards fill the board rather than sitting in a band across its middle: David, 2026-11-09). On a phone the dock is one row, what to do beside Clear, so the board has the height; your picks are the ringed cards, and the line says how many more. Tap a card to pick it, tap it again to put it back; the third tap sends the three. “Your move” is said in the dock: the first time in a browser, the house’s prompt card (“Spot a trio”) shrinks into the dock, which rings; the cue never rings the cards (David, 2026-11-09: a pulsing box round the grid put him off). On a laptop, keys pick the cards in reading order (1 to 0, then Q to P), and Escape clears.
A trio’s stage isn’t read out (read: false): the log’s spoken line says who found it, once; read too, a screen reader heard it twice (the accessibility audit, 2026-11-14).
The pace of the moments (David, 2026-11-09: the deal and a trio’s stage went by too fast to see). The deals and the stages play one after another, in the order they happened, on the room kit’s Cues (games/static/games/room/kit/motion.js), so a stage never covers a deal and a burst of news reads as a sequence:
- A deal puts the cards down one at a time, each a card’s back flying from the deck to its place (
DEAL_MS, 300 ms) and turning face up there. The opening twelve go 120 ms apart, three new or three more 180 ms apart. Until it lands, a card’s place is empty and can’t be picked, and nobody picks until the opening twelve are down (the dock says “Dealing”). A table opened mid-game shows its cards at once. - A trio’s stage is the house’s band carrying only the trio’s three cards, played down one at a time in one fixed order whichever way they were picked (David, playtest 2: “always prioritize the same quantity/shape/color order so that each set is readable at a glance”): the first feature that’s all different, of count, shape, color and fill in that order, sets it, low to high, with fill going open, shaded, solid (
inOrder, held for all 1,080 trios bytools/room/triple-take.test.mjs; a photo finish’s cards go the same way). The three go down centered on the band by themselves; then they move aside to the left as who found it writes out to their right, uncovered left to right (David, playtest 2, built at once: D21).trioStagemeasures how far: half of what comes beside them,--shift, so they start centered whatever the name’s length; on a phone, where the words go under the cards, nothing moves. Who found it shows their seat’s mark beside their name: the cards at 280 ms and every 320 ms after, the name at 1360 ms, 3200 ms in all. Then its three new cards are dealt. A bot’s find gets the same stage. - Reduced motion: nothing flies or slides. Each card of a deal and each card of a stage appears at its moment, in the same order and at the same pace.
The moments go up on the house’s announcement band over the pane (ADR 0051): a trio taken, the last trio, a photo finish (yours only), and “No trio in these twelve”. A wrong trio has no stage: its cards shake once in a dashed ring, the board dims and the dock counts down. The result sheet lays out everyone’s piles; a deck alone shows the time, and a new best is celebrated (kept in the browser, uo:triple-take:best).
The helper Say why a trio’s wrong starts on: it writes down what happened, it doesn’t find anything.
Its look#
Triple Take’s personality, in the design system’s personality sheet.
| Family | Board and party: the room kit in a look of its own. Checked on phones as closely as on a laptop. Everything else is the room kit’s (Board and party games). |
| Palette | Ink #172131 on the light table; the one fill #172131; yours and your picks #c4127a, the grease pencil; good #1f7a4d and bad #b42318. A photographer’s light table: cool lit glass with a faint grid, the cards laid on it like prints. The cards’ blue, red and yellow are the only strong colors: the primaries (David, playtest 2, built at once: D21), apart in lightness as well as hue (about 25, 51 and 84 in lightness, so they part in gray too), and checked for color blindness: under protanopia, deuteranopia and tritanopia the closest two are still about 42 apart (CIE Lab, Machado’s simulation), where navy, tangerine and gold were 23. Each has a darker shade for its edge, so the yellow reads on a white card. |
| Faces | Bricolage Grotesque for the title and the big numbers; Figtree for everything else |
| Corners and edges | Panels 14px, buttons 10px; cards with a hairline in their own darker shade |
| Board | The cards on a lighter pane: white prints with one to three shapes. Picked: lifted and circled in pink. Taken: ringed in the finder’s seat color. Wrong: a dashed red ring and one shake. New: a “New” tag until the next trio. |
| Emblem and art | Its box on the shelf: three cards of a trio side by side on the light table’s blue, the last circled in pink |
| Voice | A trio, your pile, the deck; “No trio in these twelve”, “Photo finish”, “The last trio” |
| Payoff | The room’s celebration for a win, in the cards’ colors; a personal best’s for a deck alone |
| The glance | Now: the dock (“Your move. Tap three cards…”, or why you can’t). The countdown: cards left in the deck, beside the clock. The score: trios by each name. Yours: your picks, ringed, and the dock’s three slots. |
| Exceptions | None yet |
Testing#
tests/test_triple_take.py holds the rules as sentences (taking, replacing, the beat, the freeze, photo finishes, no trio, the end, the result’s detail, bots never wrong, harder bots quicker, and bots of one level winning alike from any seat) and the table contract, played at one seat and eight. tools/triple-take/stage.py sets a table late in the deck (fifteen out, piles in two figures) or to its last trio.
Changing it#
- The shapes:
SETSandSHAPESingames/static/games/triple-take/cards.js, the names inKINDSin the rules (for the wrong-trio line), How to play and the box art. Keep every shape’s area equal. - Timings (
BEAT,FREEZE,PHOTO,NO_TRIO) are constants in the rules. The browser’s (the deal’s gaps, the stage’s beats) are at the top ofgames/static/games/triple-take/table.js: a trio’s stage and the deal after it must fit insideBEAT, or the new cards could be claimed before they’re on screen. - Bots’ speed:
SPOTandbot_think; changing them changes how bots rate against people, so rerun the anchors.
Trophy Case#
Its secret trophy in the Trophy Case, Eagle eye, waits with it until it’s listed: a whole deck won against two or more others without one wrong call, read from the result’s wrong count per seat. Counts only, never chat or words typed (ADR 0095).
Rating#
A kept game with other players is rated by place like every table game (Ratings). A deck alone has one seat, so it isn’t rated.