From cd57c16050d088b10c53fccc2b15fed4386d0168 Mon Sep 17 00:00:00 2001 From: JoshHeaps Date: Fri, 4 Sep 2026 11:18:33 -0600 Subject: [PATCH] Let the table tell the dealer who won MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An option — off by default, and off means the tool is exactly what it was. Turn it on and the community cards go on the felt. Each street asks for the cards as it is dealt: the picker opens on the flop the moment the flop button is pressed, and again on the turn and the river, because the moment a dealer is holding those cards is the only moment they know what they are without turning the board round. Three taps, then one, then one. The picker is the same sheet as the hole cards, which now knows about the middle of the table too — the seven of clubs cannot be on the flop and in somebody's hand, and until now it could. Turning the players' cards over is unchanged. That already worked the way it should. What is new is what happens next. Resolve Pot stops asking who won and says so: Alexandra wins $50 with three of a kind, nines. with every hand at the table read out under its player's name, the winner already ticked, and the button reading "Pay Alexandra". A chop comes out as "Christopher and Mike from work split it, $22.50 each, with a pair of aces", both ticked. The dealer still confirms — the tool reads the cards, a person still says the pot is good, and a hand entered wrong is corrected by unticking rather than by starting over. It declines rather than guesses. A board that isn't five cards, a player who hasn't turned over, the same card entered in two places: each says which of those it is and hands the question back, and the wizard is the one it always was. Who is *ahead* and who *won* are different claims and only the second one can pay somebody. Side pots are read per round, not once. The best hand takes the main pot and is then out of the question; the side pot goes to the best of who is left, which is a different answer and the one the tool has to ask for again. handRank.js is the only module here that can pay the wrong person without anybody noticing, so it is built to be checkable rather than clever: rank five cards, then take the best of the twenty-one five-card hands in seven. Beside the written cases — every category against every other, the wheel and the steel wheel, three kickers deep, the counterfeited two pair, the board that plays — it is checked against a second evaluator written a different way, on twenty thousand random seven-card hands and four thousand random pairs of them. An ace that keeps its value in the wheel, a dropped two-pair kicker and a flush read only by its top card were each introduced on purpose and each caught. The board takes the middle of the felt, sized from the room the seat ring actually leaves — measured against every seat rather than the ring's widest point, which is only the answer for a seat sitting exactly on the horizontal axis and had two pucks on top of the board while claiming 77px of clearance either side. Where there is no middle to take, it moves to a strip above the table: a phone on its side has a felt 528x83 with 55px pucks, so the ring closes over the centre entirely and a board in it is a board with players painted on top. That strip found an older bug. It costs the felt height, and a felt that changes size had only ever been re-measured, never laid out again: the seats follow it on their own, being placed in percentages, but a bet chip anchored inside a seat is placed in pixels off that seat's centre. Measured at 640x360, the chips were positioned for a felt 83px tall and painted on one of 60 — seat 3's $5 came to rest on seat 4's puck, and two pairs of seat pucks were overlapping. The bar growing mid-hand does the same thing: a side pot appearing is 55px off the felt. Both fixed. The sweep grew a third table — the same five players in the same nine chairs as the second, with the board on, so the only thing that differs between those two rows is the board itself. It earned its place on the first run. 728 unit tests. 216 audits: what is left is the seat ring hanging past the rail on a landscape phone, the known residual, plus five or six pixels more of it on the layouts where the strip takes the felt's height, and a blind badge over a stack on a packed twelve-seat portrait table. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb --- JoshHeaps.Net/Pages/Casino/TexasHoldem.cshtml | 16 +- JoshHeaps.Net/wwwroot/css/casino/holdem.css | 209 ++++++++- .../wwwroot/js/casino/holdem/actionBar.js | 30 +- .../wwwroot/js/casino/holdem/betting.js | 14 + .../wwwroot/js/casino/holdem/cardPicker.js | 104 ++++- .../wwwroot/js/casino/holdem/handRank.js | 285 ++++++++++++ .../wwwroot/js/casino/holdem/main.js | 9 + .../wwwroot/js/casino/holdem/potWizard.js | 124 +++++- .../wwwroot/js/casino/holdem/render.js | 197 ++++++++- .../wwwroot/js/casino/holdem/state.js | 29 ++ tests/holdem/README.md | 47 +- tests/holdem/board.test.js | 118 +++++ tests/holdem/feltRoom.test.js | 71 +++ tests/holdem/handRank.test.js | 415 ++++++++++++++++++ tests/holdem/load.js | 7 + tests/holdem/readingTheShowdown.test.js | 274 ++++++++++++ tests/holdem/runUiAudit.js | 37 +- 17 files changed, 1918 insertions(+), 68 deletions(-) create mode 100644 JoshHeaps.Net/wwwroot/js/casino/holdem/handRank.js create mode 100644 tests/holdem/board.test.js create mode 100644 tests/holdem/handRank.test.js create mode 100644 tests/holdem/readingTheShowdown.test.js diff --git a/JoshHeaps.Net/Pages/Casino/TexasHoldem.cshtml b/JoshHeaps.Net/Pages/Casino/TexasHoldem.cshtml index bd78595..b5951ae 100644 --- a/JoshHeaps.Net/Pages/Casino/TexasHoldem.cshtml +++ b/JoshHeaps.Net/Pages/Casino/TexasHoldem.cshtml @@ -29,11 +29,15 @@
+
-
- Pot - $0 +
+ +
+ Pot + $0 +
@@ -81,6 +85,11 @@

Turn this on if a person outside the game deals — no seat shows the dealer button, but blinds still rotate automatically each hand.

+ +

Puts the community cards on the felt and asks for them as each street is dealt. Turn the players’ cards over at showdown and Resolve Pot works out who won and how much, instead of asking you.