Skip to content

blackjack: back another seat (behind bet + their Perfect Pairs)#81

Merged
BCook98 merged 3 commits into
mainfrom
blackjack-back-another-seat
Jun 29, 2026
Merged

blackjack: back another seat (behind bet + their Perfect Pairs)#81
BCook98 merged 3 commits into
mainfrom
blackjack-back-another-seat

Conversation

@BCook98

@BCook98 BCook98 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What

Lets a player wager on another seat, two ways:

  • Behind bet — rides the backed player's MAIN hand vs the dealer (their first hand only; does not follow their doubles/splits).
  • Their Perfect Pairs — a Perfect Pairs bet on the backed player's first two cards (25/12/6, same schedule as your own).

Builds on the Perfect Pairs work in #80.

Betting controls

  • Up/Down — your own main stake.
  • Left/Right — change which seat you're betting on (yourself, then each other seat).
  • P — loop the Perfect Pairs side bet for the focused seat (yours, or theirs) — cycles up a tier, resets to 0 past the top.
  • B — loop the behind bet on the focused seat (none on yourself) — same looping.
  • Space — place everything. Back any number of seats; every raise is budget-clamped to your chips.

Settlement

  • Their-pairs resolve at the deal (voided if the target sat out).
  • The behind bet resolves at the dealer reveal on the target's first hand — even money, 3:2 on a natural blackjack, push returns the stake, refund if the backed player left mid-round.
  • All back deltas fold into the backer's round net.

Display

The relocated rules tagline (#80) freed rows 8–9, so the seat block shifts up one row to open a dedicated backers line: each backed seat lists its backers by character tile with a compact stake (betting) / net (results); focusing a seat spells out your back on the action bar (BACKING ⟨tile⟩seat1 B behind 25 P pairs 10 Left/Right seat).

Tests

  • Unit: affordTier / loopTier budget clamp + reset-to-0; behind-bet settlement via room tests (win/refund/void).
  • Room/render: Left/Right focus cycling (both directions, skips self/empty, no-op solo), P loops pairs (own + back) and resets to 0, B loops behind, budget clamping, deal resolves back-pairs and voids a sat-out target, settle folds behind + back-pairs and refunds when the target left, backers line tiles, focused-target detail.
  • smoke.yaml (seed 58): seat0 backs seat1 (behind + their pairs) — BACKING focus screen, backers line, payout folded in (seat0 WIN +155, seat1 WIN +145).
  • go test ./... green, go vet clean. game.wasm not committed; smoke-out/ is gitignored (CI regenerates the preview).

Note: on the touch deck, P shares the SPLIT chip (used during turns); B is the BEHIND chip. Keyboard play is clean and the action bar spells the mapping out.

🤖 Generated with Claude Code

Let a player wager on another seat two ways: a "behind" bet that rides
the backed player's first hand vs the dealer, and a Perfect Pairs bet on
the backed player's first two cards.

- Betting gains a focus-cycle: B moves the editing focus across yourself
  and each other seat; Up/Down and Left/Right then edit whoever is
  focused (your stake+pairs, or a back's behind+their-pairs). Every raise
  is clamped to your total chip budget. Back any number of seats.
- Their-Perfect-Pairs settle at the deal (25/12/6, voided if the target
  sat out); the behind bet settles at the dealer reveal on the target's
  first hand (even money, 3:2 on a natural blackjack, push), refunded if
  the target left mid-round. All back deltas fold into the backer's net.
- The relocated rules tagline freed rows 8-9, so the seat block shifts up
  one row to open a dedicated, tile-attributed backers line: each backed
  seat lists its backers' character tiles with their stake (betting) or
  net (results). Focused detail shows on the action bar.

Adds the B (BACK) touch control. New unit/render tests cover focus
cycling, budget clamping, deal/settle resolution (win/refund/void), the
backers line, and the focused-target detail. smoke.yaml extended so
seat0 backs seat1 (behind + their pairs) with focus and payout shots.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown

Smoke screens

Deterministic scripted screens for 8a6a4fb012046bc4c675606cd8280a82fad3832d (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

BCook98 and others added 2 commits June 29, 2026 20:06
… pairs

Reworks the back-a-seat betting controls for clarity:

- Left/Right now change which seat you're betting on (yourself, then each
  other seat), matching the rail spatially — replacing the dedicated B
  focus-cycle key.
- Up/Down set the focused seat's hand bet (your stake, or the behind bet
  on a backed seat) — unchanged.
- P / B cycle the Perfect Pairs side bet up / down for the focused seat
  (yours, or theirs) — moved off Left/Right, and B gives a backward step
  so the tiers no longer wrap-only.

The B touch control is relabelled PAIRS. Action-bar hints and the smoke
scenario are updated to the new mapping; the round still reconciles
(seat0 WIN +155, seat1 WIN +145).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Per-bet looping keys during betting, each cycling up a tier and
resetting to 0 past the top:

- P loops the Perfect Pairs side bet for the focused seat (yours, or
  theirs when focused on another seat).
- B loops the behind bet on the focused seat (none on yourself).
- Up/Down stay on your own main stake; Left/Right still pick the seat.

Behind moves off Up/Down onto B, so each side bet has a single dedicated
cycle key. The B touch control is relabelled BEHIND. Hints and the smoke
scenario updated; the round still reconciles (seat0 WIN +155).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@BCook98 BCook98 merged commit 39517a2 into main Jun 29, 2026
3 checks passed
@BCook98 BCook98 deleted the blackjack-back-another-seat branch June 29, 2026 10:13
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