Give the odd chip to the player the rule says gets it #40

Closed
jheaps wants to merge 0 commits from feature/casino-holdem-odd-chip into master
Owner

Fourth rules check, found by following the pattern behind #37 and #39 — the tool ordering by seat index where the game orders from the button.

Quick Split tells the dealer a leftover chip goes "to the first player left of the button". The pot wizard, in the same tool, handed it to whoever the dealer happened to tick first. Two screens, same split, different answer.

Demonstrated before fixing: button on S3, seats 1 and 5 chopping $5.01 — the wizard paid S1 $2.51 / S5 $2.50, when the rule (and the tools own other screen) says S5 takes the extra cent.

The wizard now orders winners around the table from the button before the calculator shares the pot out. The calculator is unchanged — it already gave leftovers to the front of the list; it was simply being handed the list in checkbox order.

It is pennies. But it is pennies in front of the person who did not get them, and a dealer who has just read the other screens instruction aloud looks wrong.

Validation (Playwright, headed)

Every case ticks the winners in reverse seat order, so a pass proves the result no longer depends on the order the dealer clicked:

  • Button S3, winners S1/S5 → S5 takes the odd cent (was S1).
  • Button S4 → still S5. Button S5, who is himself a winner → S1 takes it, correctly not the button holder.
  • Three-way chop that divides evenly → all equal, no leftover invented.
  • Counterclockwise table → S1, since "next player" runs the other way.
  • 500 randomised chops (3–8 seats, 2–4 winners, both directions, random amounts, shuffled click order): winners are always ordered by distance from the button, and every cent of the pot is still paid out. Zero failures.

git merge-tree reports zero conflicts against all six other open PRs, including #34, which also edits potWizard.js. No console errors.

Fourth rules check, found by following the pattern behind #37 and #39 — **the tool ordering by seat index where the game orders from the button**. Quick Split tells the dealer a leftover chip goes *"to the first player left of the button"*. The pot wizard, in the same tool, handed it to **whoever the dealer happened to tick first**. Two screens, same split, different answer. Demonstrated before fixing: button on S3, seats 1 and 5 chopping $5.01 — the wizard paid **S1 $2.51 / S5 $2.50**, when the rule (and the tools own other screen) says S5 takes the extra cent. The wizard now orders winners around the table from the button before the calculator shares the pot out. **The calculator is unchanged** — it already gave leftovers to the front of the list; it was simply being handed the list in checkbox order. It is pennies. But it is pennies in front of the person who did not get them, and a dealer who has just read the other screens instruction aloud looks wrong. ## Validation (Playwright, headed) Every case ticks the winners in **reverse seat order**, so a pass proves the result no longer depends on the order the dealer clicked: - Button S3, winners S1/S5 → **S5** takes the odd cent (was S1). - Button S4 → still S5. Button **S5, who is himself a winner** → S1 takes it, correctly *not* the button holder. - Three-way chop that divides evenly → all equal, no leftover invented. - **Counterclockwise table** → S1, since "next player" runs the other way. - **500 randomised chops** (3–8 seats, 2–4 winners, both directions, random amounts, shuffled click order): winners are always ordered by distance from the button, and every cent of the pot is still paid out. Zero failures. `git merge-tree` reports **zero conflicts against all six other open PRs**, including #34, which also edits `potWizard.js`. No console errors.
jheaps added 1 commit 2026-09-01 02:05:59 -06:00
Quick Split tells the dealer a leftover chip goes "to the first player left of
the button". The pot wizard, on the same tool, handed it to whoever the dealer
happened to tick first. Two screens, same split, different answer.

The wizard now orders the winners around the table from the button before the
calculator shares the pot out, so the leftover lands where the instruction says
it does. The calculator itself is unchanged — it already gave leftovers to the
front of the list, it was just being handed the list in the order the checkboxes
were clicked.

It's pennies, but it's pennies in front of the person who didn't get them, and a
dealer who has just read the other screen's instruction out loud looks wrong.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015bnp7xKUPFFSpwkYNFaPgb
jheaps closed this pull request 2026-09-01 02:42:18 -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#40