Repository navigation
feat(holdem): call out bad beats at showdown - #105
Merged
Merged
Conversation
- Add a pure oddsRunner that enumerates flop and turn boards exactly and samples 20,000 fixed-seed boards preflop, in time slices. - Show win percent and a separate tie figure on each contesting seat once betting is over and every live hand is face up. - Delay the figures until the new street's cards land and read only face-up cards. Claude-Session: https://claude.ai/code/session_01SiinSXHP71xKCXmAjpTHaM
- Add findBadBeat, which flags a loser who had 75% or more before the river, using the runout odds. - Show a short BAD BEAT callout with the loser's name and hand for 2s inside the showdown beat, static under reduced motion. - Tag the main-pot winner's banner row RIVERED. Claude-Session: https://claude.ai/code/session_01SiinSXHP71xKCXmAjpTHaM
# Conflicts: # components/texasholdem/TexasHoldem.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a big favorite loses on the river of an all-in runout, the table calls it out: a short "BAD BEAT" callout over the felt and a "RIVERED" tag on the winner's row.
Changes
findBadBeatin lib/texasholdem/badbeat.ts: a contender who lost the main pot and had 75% or more to win with the four board cards from before the river. At most one qualifies, so at most one callout per hand.Why
Bad beats are the stories people retell. A call-out gives the loser sympathy and the winner a moment to gloat, with no added delay.
Testing
pnpm lint,pnpm typecheck,pnpm test(372 passing) andpnpm buildpass.Notes
This PR is stacked on #89 (it reuses
oddsRunner), so its base isonyx/runout-odds; retarget to main after #103 merges. Only hands that ran out after betting closed count, tracked from the runout the client saw, so a river bet-and-call or a mid-hand reload never produces a callout.Closes #90