Count the house's cut instead of calling it missing chips #106

Closed
jheaps wants to merge 1 commits from feat/casino-holdem-rake into fix/casino-holdem-stadium-ring
Owner

A game that takes a rake has chips leaving the table every hand, and the bank check had no idea. It added up the buy-ins, added up the chips on the felt, and told the dealer somebody had been paid for chips they were never given — a shortfall that grows all night and points at a miscount that never happened. Every home game that takes a drop for the beer fund hits this on hand one.

So the tool takes it, rather than watching it go. Under Table Setup → House take: a percentage, an optional cap, and no flop, no drop — the rule almost everyone plays, on by default, where a hand that ends before the flop pays nothing. Zero percent is a game that doesn't rake, which is most of them and the default, and nothing about that game changes.

Where it shows up is the point:

  • The pot wizard says "House takes $2 of $40 — 5%, capped at $5" above the payouts, before a chip moves. The summary is the dealer's last chance to disagree with the arithmetic, and money taken quietly is the one thing a tool like this must never do.
  • The bank check gets a House take line and reads "balanced … once the $2 in the house's cut is counted".
  • The hand log keeps the pot as the table saw it with the cut beside it, and the CSV gets a column, so the night's total is one sum in a spreadsheet.
  • The rake panel shows the running total: "Taken so far tonight: $2."

Two decisions worth stating

It rounds down to a chip the table actually has. A house that can't make 40c takes nothing and the players keep it — the only way to be wrong about this that nobody argues with.

On a split pot it comes off the top, then what's left is shared in proportion, with the rounding leftovers going back to the winners rather than to the house. The house asked for a number; it gets that number, not that number plus dust.

Validated

  • End to end through the UI: rake set in the sidebar, hand played out, 5% capped at $5 on a $40 pot → wizard shows the cut, Cal is paid $38, rakeTaken is $2, the log reads pot 40 / rake 2, and four stacks plus the cut come to exactly the $800 bought in. Bank check: balanced.
  • Both sides of no-flop-no-drop: a hand folded round pre-flop pays the full $15 and takes nothing with it on; the same hand pays $14 and takes $1 with it off.
  • 23 new tests, suite at 483, 0 failures. Two rules were broken on purpose first: dropping the rake from the bank check fails 4 tests, and rounding the cut up instead of down fails another.
  • 156 layout audits across 13 viewports, mouse and thumb, with the new panel open and a rake set: clean, no console errors.
A game that takes a rake has chips leaving the table every hand, and the bank check had no idea. It added up the buy-ins, added up the chips on the felt, and told the dealer **somebody had been paid for chips they were never given** — a shortfall that grows all night and points at a miscount that never happened. Every home game that takes a drop for the beer fund hits this on hand one. So the tool takes it, rather than watching it go. Under **Table Setup → House take**: a percentage, an optional cap, and *no flop, no drop* — the rule almost everyone plays, on by default, where a hand that ends before the flop pays nothing. Zero percent is a game that doesn't rake, which is most of them and the default, and nothing about that game changes. **Where it shows up is the point:** - The pot wizard says *"House takes $2 of $40 — 5%, capped at $5"* above the payouts, **before a chip moves**. The summary is the dealer's last chance to disagree with the arithmetic, and money taken quietly is the one thing a tool like this must never do. - The bank check gets a **House take** line and reads *"balanced … once the $2 in the house's cut is counted"*. - The hand log keeps the pot as the table saw it with the cut beside it, and the CSV gets a column, so the night's total is one sum in a spreadsheet. - The rake panel shows the running total: *"Taken so far tonight: $2."* ### Two decisions worth stating **It rounds down** to a chip the table actually has. A house that can't make 40c takes nothing and the players keep it — the only way to be wrong about this that nobody argues with. **On a split pot it comes off the top**, then what's left is shared in proportion, with the rounding leftovers going back to the winners rather than to the house. The house asked for a number; it gets that number, not that number plus dust. ### Validated - **End to end through the UI**: rake set in the sidebar, hand played out, 5% capped at $5 on a $40 pot → wizard shows the cut, Cal is paid **$38**, `rakeTaken` is $2, the log reads pot 40 / rake 2, and four stacks plus the cut come to exactly the **$800 bought in**. Bank check: balanced. - **Both sides of no-flop-no-drop**: a hand folded round pre-flop pays the full $15 and takes nothing with it on; the same hand pays $14 and takes $1 with it off. - 23 new tests, suite at **483, 0 failures**. Two rules were broken on purpose first: dropping the rake from the bank check fails 4 tests, and rounding the cut *up* instead of down fails another. - 156 layout audits across 13 viewports, mouse and thumb, with the new panel open and a rake set: clean, no console errors.
jheaps added 1 commit 2026-09-02 05:13:03 -06:00
A game that takes a rake has chips leaving the table every hand, and the bank
check had no idea. It added up the buy-ins, added up the chips on the felt, and
told the dealer somebody had been paid for chips they were never given — a
shortfall that grows all night and points at a miscount that never happened.
Every home game that takes a drop for the beer fund hits this on hand one.

So the tool takes it, rather than watching it go. Under Table Setup: a
percentage, an optional cap, and "no flop, no drop" — the rule almost everyone
plays, on by default, where a hand that ends before the flop pays nothing. Zero
percent is a game that doesn't rake, which is most of them and the default, and
nothing about that game changes.

Where it shows up is the point. The pot wizard says "House takes $2 of $40 — 5%,
capped at $5" above the payouts, before a chip moves, because the summary is the
dealer's last chance to disagree with the arithmetic and money taken quietly is
the one thing a tool like this must never do. The bank check gets a House take
line and says "balanced ... once the $2 in the house's cut is counted". The hand
log keeps the pot as the table saw it with the cut recorded beside it, and the
export has a column for it, so the night's total is one sum in a spreadsheet.

Two decisions worth stating. The rake rounds *down* to a chip the table actually
has: a house that can't make 40c takes nothing and the players keep it, which is
the only way to be wrong about this that nobody argues with. And on a split pot
it comes off the top, then what is left is shared in proportion — with the
rounding leftovers going back to the winners rather than to the house, which
asked for a number and gets that number, not that number plus dust.

Measured end to end through the UI: 5% capped at $5 on a $40 pot pays $38 and
banks $2; four stacks plus the cut come to exactly the $800 bought in; the bank
check reads balanced. With no-flop-no-drop on, a hand folded round pre-flop pays
the full $15 and takes nothing; with it off the same hand pays $14 and takes $1.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps closed this pull request 2026-09-02 09:58:06 -06:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jheaps/JoshHeaps.Net#106