Skip to content

rummy: gin, 10-card and a variant picker - #390

Merged
aaylward merged 5 commits into
mainfrom
claude/rummy-game-backend-ui-fvxk0l
Sep 29, 2026
Merged

aaylward merged 5 commits into
mainfrom
claude/rummy-game-backend-ui-fvxk0l

Conversation

@aaylward

@aaylward aaylward commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

UI for MoonBase#1610. Deploy this before MoonBase#1613: it works against the current hub, which doesn't send canDrawDiscard.

  • Dealer's choice: the dealer picks the game from one list with one Deal button, instead of a button per variant.
    • The list starts at the last deal's game, and a pick holds only for its own deal.
    • It is hidden when only one game is offered.
    • It is in the deal-end sheet's tab order.
  • Gin at the table:
    • Take or pass the upcard.
    • Stock only once both players pass.
    • No melding.
    • Knock is enabled only when the chosen throw leaves 10 or less deadwood, and never on the card just taken. The hint says what the throw would leave.
  • Deal-end sheet: shows both hands as the hub arranged them, plus any lay-offs.
  • Hand: new by melds sort.
  • Parity: bestArrangement replays MoonBase's arrange_corpus.json (a copy lives here).
  • Stats: new label gin.

Checked with vitest, tsc and eslint. One gin deal was played end to end in a browser against a local hub, with one seat at phone size. The wider lobby and table UX work is tracked in #389.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
muchq 6e7e568 Commit Preview URL

Branch Preview URL
Sep 29 2026, 03:04 PM

@cursor

cursor Bot commented Sep 29, 2026

Copy link
Copy Markdown

Blocking

None. Wire matches MoonBase rummy.smithy (upcard / pass / knock / canDrawDiscard / lastDeal.gin); older hubs without canDrawDiscard keep the discard drawable while it has a top; knock is gated on canDiscard (so the just-taken card can’t be knocked) and bestArrangement ≤ 10; melds stay off the gin felt; the deal-end sheet reads the hub’s arranged hands and lay-offs; the variant list is one pick + one Deal, scoped to its deal, hidden when there’s only one option, and inside the sheet’s tab loop. Ace high/low (never wrapping) is pinned for lay-offs and knocks. CI green.

Nits

  • VARIANT_LABELS drops basic entirely. The PR’s own rollout is UI-first against a hub that still deals basic, so the Deal button becomes “Deal basic” until MoonBase#1613 is live. Keep an alias (basic: '7-card rummy' or the old “Basic rummy”) for that window.
  • Copied arrange_corpus.json includes a layOff section nothing replays. Fine if the file is meant to stay a verbatim MoonBase copy; otherwise trim it or note that only arrange is the TS parity surface (the hub owns lay-offs at knock).
  • When a knock is armed, Discard stays primary and Knock secondary — easy to throw a knockable hand. Prefer Knock as primary (or equal weight) while mayKnock.

Fine

Dealer’s-choice list + Deal; gin upcard take/pass with stock held until both pass; deadwood hint on the selected throw; by melds sort; stats gin label; docs note against scheduled PR check-ins. MoonBase#1613 is already merged — deploy this so a gin table’s hub view has chrome that understands it. Wider lobby/table polish stays in #389.


Review of #390

Copy link
Copy Markdown
Contributor Author

Nits, in 6e7e568:

  • basic now labels as "7-card rummy", which covers a hub that hasn't been redeployed yet.
  • An armed knock is now the primary button, with Discard secondary. Both are pinned.
  • arrange_corpus.json stays a verbatim copy of MoonBase's. Only its arrange cases are replayed here, because the hub owns lay-offs at the knock.

Generated by Claude Code

@aaylward
aaylward merged commit fb5362f into main Sep 29, 2026
2 checks passed
@aaylward
aaylward deleted the claude/rummy-game-backend-ui-fvxk0l branch September 29, 2026 15:23
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.

2 participants