Skip to content

Add Ask the Dealer to Training and Standard modes - #3

Merged
ruthlessfish merged 1 commit into
masterfrom
2-ask-the-dealer
Sep 23, 2026
Merged

ruthlessfish merged 1 commit into
masterfrom
2-ask-the-dealer

Conversation

@ruthlessfish

Copy link
Copy Markdown
Owner

Closes #2

Training

  • Ask dealer (button or A) shows the Basic Strategy play for the current hand.
  • Asking ends the live streak, and that hand isn't added to Hands or Correct. All four move buttons stay enabled, and a wrong pick still shows the usual feedback.
  • The button is then unavailable for the next 3 hands and shows recharging (n).

Standard

  • You can ask once per decision (after a hit and on each split hand too). The advice is right dealerAccuracy% of the time, starting at 50; otherwise it's a random other legal move.
  • If you follow correct advice at least once in a round, a new tip phase comes after the round settles: Tip $5 or No thanks (Y / N). The auto-sweep waits until you choose.
  • A tip adds 5 to the accuracy and a refusal takes 5 off, kept between 0 and 100.
  • The prompt is skipped if the balance can't cover $5. A tip that leaves the balance under the minimum bet triggers the usual out-of-funds reset.
  • The accuracy is never saved, so it resets whenever a table is created (reload, or leaving to the menu and coming back).
  • The prompt also shows when good advice was followed but the hand still lost, since the issue ties the tip to following correct advice, not to winning.

Other changes

  • logic/ still has no Phaser imports. StandardGame takes a random option and TrainingSession takes an optional shoe, so tests can control the dealer's luck and stack the cards.
  • Button has a new setSublabel().
  • CLAUDE.md has a note on the feature.

Testing

  • npm test: 142 passing, including a new tests/TrainingSession.test.ts and an Ask the Dealer block in tests/StandardGame.test.ts.
  • npx tsc --noEmit is clean.
  • Played both modes in Chrome: the Training reveal and recharge, and the Standard tip prompt. Tipping takes $5 and raises the accuracy to 55. No console errors.

🤖 Generated with Claude Code

Training: reveals the Basic Strategy play, ends the live streak, leaves the
hand out of the stats, and recharges over the next three hands.

Standard: the dealer suggests a move per decision, right 50% of the time at
first. Following good advice asks for a $5 tip after the round settles; a tip
raises the dealer's accuracy by 5 points and a refusal lowers it, within
0-100. The accuracy is not saved.

Closes #2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ruthlessfish ruthlessfish linked an issue Sep 22, 2026 that may be closed by this pull request
@vercel

vercel Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
blackjack Ready Ready Preview Sep 22, 2026 11:02pm UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The Button compile error blocks the build, and Training does not keep Split available for feedback on non-pair hands.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Adds Ask the Dealer functionality to Training and Standard blackjack modes, including recharge behavior, probabilistic advice, tipping, and accuracy tracking.

Changes:

  • Added Training advice reveal, streak handling, and recharge UI.
  • Added Standard advice, tip prompts, and accuracy adjustments.
  • Updated controls, logic types/constants, tests, and documentation.
File Reviewed change / final note
tests/​TrainingSession.test.ts Adds Training advice and recharge coverage.
tests/​StandardGame.test.ts Adds Standard advice and tipping coverage. Nit (1 vote): add split-hand advice coverage.
src/​game/​ui/​Button.ts Adds dynamic sublabels. Critical (2 votes): readonly sub assignment causes TS2540 and blocks the build.
src/​game/​scenes/​Training.ts Adds the Training Ask Dealer control.
src/​game/​scenes/​Standard.ts Adds Standard advice and tip controls.
src/​game/​logic/​types.ts Adds advice, recharge, and tip state types.
src/​game/​logic/​TrainingSession.ts Implements Training advice logic. Moderate (1 vote): Split remains unavailable on non-pair hands after asking.
src/​game/​logic/​StandardGame.ts Implements Standard advice, tipping, and accuracy behavior.
src/​game/​logic/​constants.ts Defines feature constants.
CLAUDE.md Documents the feature behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/game/ui/Button.ts
@ruthlessfish
ruthlessfish merged commit e146d9b into master Sep 23, 2026
4 checks passed
@ruthlessfish
ruthlessfish deleted the 2-ask-the-dealer branch September 23, 2026 00:32

This branch was successfully deployed

1 active deployment
Preview — fa2e1aa6 Deployed Sep 22, 2026 by vercel[bot]
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.

Ask the Dealer

2 participants