blackjack: fix pairs spoiler, insurance summary, and 5+ card overflow#85
Merged
Conversation
… (#feedback)
Three player-reported issues at the table:
- Perfect Pairs showed its verdict ("pairs lost" / the win) the instant the
hand was dealt, before the second card had animated in — spoiling the reveal.
Hold the verdict until both of the seat's first two cards are face up
(new seatCardFaceUp helper mirrors dealerCardFaceUp).
- Insurance read as broken: its stake/payout were never folded into the results
net, so an insured loss to a dealer blackjack showed LOSE while the chip stack
broke even. Track the payout and fold its delta into the settlement net (a
fully-covered loss now reads PUSH). Also spell the side bet out in the offer
prompt — "Stake N that dealer has blackjack - pays 2:1" — instead of just
naming it.
- A hand of 5+ cards has a card box wider than the 15-col seat slot, so it
spilled into the neighbouring seat. Fall back to the compact one-line
rendering (as split hands already do) once the box no longer fits.
Regression tests cover all three.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Smoke screensDeterministic scripted screens for |
Follow-up feedback on the same table:
- The Perfect Pairs stake ("+pairs N") during betting was drawn in the bright
own-seat cyan, louder than the dim "bet N" beside it. Match the bet colour so
the side stake reads as part of the same quiet bet block.
- Split aces keep the one-card rule (each split ace takes exactly one card and
stands), but two things made that read as a bug: a split ace that drew a ten
showed "BJ" as if it were a natural blackjack, and the turn passed on with no
explanation. Now a split two-card 21 reads as a plain "21" (it pays even money,
not 3:2), and the seat names the rule — "aces: 1 card" — beneath the locked
hands so the skipped turn reads as intended.
Regression tests cover the label and the note.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Fixes player-reported issues at the blackjack table.
1. Perfect Pairs spoiled its result before the second card was revealed
The side-bet verdict is fixed at the deal, but the seat's pairs line rendered "pairs lost" (or the win label) the instant the hand existed — while the second card was still sliding/flipping in. Now the verdict is held until both of the seat's first two cards are face up, via a new
seatCardFaceUphelper that mirrors the existingdealerCardFaceUp.2. Insurance read as broken + wasn't explained
LOSE -100even though the 2:1 payout left the chip stack unchanged. The payout is now tracked (insuranceWin) and its delta folded into the settlement net, so a fully-covered loss correctly readsPUSH.Insurance? Stake N that dealer has blackjack - pays 2:1— instead of just naming it.3. Hands of 5+ cards spilled into the neighbouring seat
A 5-card card box is 16 cols wide but the seat slot is 15, so it overflowed into the next seat. Such a hand now falls back to the compact one-line rendering that split hands already use, keeping it inside its slot.
4. Perfect Pairs stake was too bright
The
+pairs Nstake during betting was drawn in the bright own-seat cyan, louder than the dimbet Nbeside it. It now matches the bet colour so the side stake reads as part of the same quiet bet block.5. Splitting aces read as a bug ("can't play, moves on immediately")
Split aces keep the standard one-card rule (each split ace takes exactly one card and stands), but two things made that read as a bug:
Tests
Added regression tests for every fix, each confirmed to fail without its change. Full suite,
go vet, andgofmtall clean.🤖 Generated with Claude Code