Skip to content

feat(holdem): offer to run the board twice when everyone is all in - #104

Merged
JonasFocus merged 4 commits into
mainfrom
onyx/double-runout
Oct 20, 2026
Merged

JonasFocus merged 4 commits into
mainfrom
onyx/double-runout

Conversation

@JonasFocus

Copy link
Copy Markdown
Owner

Summary

When every live player is all in before the river, the table can agree to run the board twice and split the pot by runout.

Changes

  • Engine: when the betting ends with at most one player able to act and the board is not complete, everyone in the pot gets a 5 second "Run it twice?" prompt. It runs twice only if every player says yes; any no or an expired timer deals once as before.
  • Each pot, side pots included, is split in half by board, with the odd chip on the first board. An uncalled bet is still returned whole. Results carry the second hand, and win rows and card highlights follow the board each player won on.
  • A host toggle in the lobby (on by default), new setRunTwice and runTwice intents with strict parsing, and a Yes / No prompt in the action panel.
  • Both boards are shown stacked on the felt, and the second board only exists in state once its cards are dealt, so no undealt card reaches a client.

Why

Closes #60. A common home-game option for all-ins before the river, behind a setting so it never surprises a table.

Testing

  • New engine tests: prompt, toggle, host and lobby only, unanimous yes, a no, timeout, voting rules, split by board, side pots, odd chip, flop and preflop all-ins, redaction, intent parsing, and a 200 hand fuzz for chip conservation.
  • Manual run against a local server and dev build with a scripted opponent: the prompt appeared, Yes ran both boards, and the layout measured clear of the pot and the win banner.
  • lint, typecheck, test and build pass.

Notes

  • Bots always agree and are never asked. Nobody is asked if a human in the pot is offline, since they cannot answer.
  • The second board repeats the shared cards, so the shared flop deals in again on the second row.

- Ask everyone in the pot for 5s once the betting is over before the river; it runs twice only if every player agrees
- Split each pot, side pots included, in half by board with the odd chip on the first board
- Add a host toggle in the lobby (on by default) and show both boards stacked

Claude-Session: https://claude.ai/code/session_01SiinSXHP71xKCXmAjpTHaM
@JonasFocus JonasFocus added the ready Green and self-reviewed; waiting for merge label Oct 20, 2026
# Conflicts:
#	lib/texasholdem/index.ts
#	lib/texasholdem/winners.ts
# Conflicts:
#	components/texasholdem/TexasHoldem.tsx
#	lib/texasholdem/rules.ts
@JonasFocus
JonasFocus merged commit 89beddc into main Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Green and self-reviewed; waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offer run it twice when everyone is all-in

1 participant