Skip to content

blackjack: fix pairs spoiler, insurance summary, and 5+ card overflow#85

Merged
BCook98 merged 2 commits into
mainfrom
blackjack-feedback-fixes
Jul 3, 2026
Merged

blackjack: fix pairs spoiler, insurance summary, and 5+ card overflow#85
BCook98 merged 2 commits into
mainfrom
blackjack-feedback-fixes

Conversation

@BCook98

@BCook98 BCook98 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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 seatCardFaceUp helper that mirrors the existing dealerCardFaceUp.

2. Insurance read as broken + wasn't explained

  • Summary reconciliation: the insurance stake/payout were never folded into the results net. An insured loss to a dealer blackjack showed LOSE -100 even 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 reads PUSH.
  • Explanation: the offer prompt now spells the bet out — 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 N stake during betting was drawn in the bright own-seat cyan, louder than the dim bet N beside 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:

  • A split ace that drew a ten-value showed "BJ" as if it were a natural blackjack. A split two-card 21 now reads as a plain "21" (it pays even money, not 3:2).
  • The turn passed on with no explanation. The seat now names the rule — "aces: 1 card" — beneath the locked hands.

Tests

Added regression tests for every fix, each confirmed to fail without its change. Full suite, go vet, and gofmt all clean.

🤖 Generated with Claude Code

… (#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>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Smoke screens

Deterministic scripted screens for af49d2189e7c9c917377af0ba86a16ca26d0da8d (what is this?)

games/bcook/blackjack — 16 screens

01-bet.seat0
01-bet.seat0

01-bet.seat1
01-bet.seat1

02-backing.seat0
02-backing.seat0

02-backing.seat1
02-backing.seat1

03-sidebet.seat0
03-sidebet.seat0

03-sidebet.seat1
03-sidebet.seat1

04-dealt.seat0
04-dealt.seat0

04-dealt.seat1
04-dealt.seat1

05-split.seat0
05-split.seat0

05-split.seat1
05-split.seat1

06-payout.seat0
06-payout.seat0

06-payout.seat1
06-payout.seat1

07-ready.seat0
07-ready.seat0

07-ready.seat1
07-ready.seat1

08-next.seat0
08-next.seat0

08-next.seat1
08-next.seat1

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>
@BCook98 BCook98 merged commit aad5843 into main Jul 3, 2026
3 checks passed
@BCook98 BCook98 deleted the blackjack-feedback-fixes branch July 3, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant