Modern American Canasta as a third rule set
Summary. Add Modern American Canasta as spec/rulesets/modern-american.json, a third Canasta rule
set next to official and family. We don’t add a new game, and we don’t branch on a rule-set id.
Each difference from Classic becomes a rule-set setting, added to every rule set with a value that
keeps official and family playing exactly as they do now. Each setting is pinned by scenarios
that switch it on with overrides, so the three cores can build it before the rule set exists.
There are eight checkpoints, one issue and one PR each, spec plus all three cores. Scoring comes
first because it is pure and changes no state, protocol or screen. The rule-set file comes last,
together with its bots and parity games, so no app offers Modern American before every rule it
needs is built. Special hands (straight, pairs, garbage) are the last checkpoint and optional.
Sources
| Source | What it gives | Use |
|---|---|---|
| Pagat, “Modern American Canasta” (2017 description; opened 2026-11-25) | The full rules: deal, melds, play, threes, initial meld, end of play, special hands, scoring, and a long list of table rules | Base: the rule set’s source, as official.json cites Pagat’s Classic |
| Canasta League of America, “Rules” (opened 2026-11-25) | The league’s quick reference: the same core rules, a stricter opening (a “clean triple” is required, no unnatural canasta as an opening), “SWAD” discards, and eleven special hands | Where it differs from Pagat, the difference becomes a setting where that is cheap (see Differences) |
| canasta.org.za, “Modern American Canasta” | A club’s summary; its opening table (15/50/90/120) is Classic’s, so it is not used | Not used |
What Modern American changes, and where each change lands
The Field column lists new rule-set settings. Each one goes into every rule set, with the
Classic/Family value that keeps today’s play, so official and family play exactly as before.
| # | Rule (Pagat unless noted) | Field (new unless marked existing) | Modern American | Classic / Family | Checkpoint |
|---|---|---|---|---|---|
| 1 | Pure canasta of aces or sevens: 2500 | canastaBonus.naturalByRank |
[{A, 2500}, {7, 2500}] |
[] |
MA1 |
| 2 | Twos-only wild canasta 3000, four jokers + three twos 2500, other wild 2000 | existing wildCanastas.bonus, exactBonuses |
2000; {0 jokers, 7 twos, 3000}, {4, 3, 2500} |
unchanged | MA1 (data only) |
| 3 | Unfinished pure aces or sevens: −2500; unfinished wild meld −2000, or −2500 with all four jokers | unfinishedMeldPenalties |
see MA1 | [] |
MA1 |
| 4 | Three or more sevens, or aces, left in one player’s hand: −1500 each | cardsInHandPenalties |
[{7, 3, 1500}, {A, 3, 1500}] |
[] |
MA1 |
| 5 | A side with no canasta loses its melded cards’ points instead of scoring them | meldsWithoutCanasta |
subtract |
add |
MA1 |
| 6 | A meld never holds more than seven cards; a 5- or 6-card meld cannot take the pile | melds.maxCards |
7 |
null (no limit) |
MA2 |
| 7 | A closed natural canasta makes its rank dead for both sides | melds.closedRank |
dead |
open |
MA2 |
| 8 | At most two wilds per meld | existing melds.maxWilds |
2 |
3 |
MA2 (data only) |
| 9 | “Rule of five”: after the opening, a wild joins a meld only once it holds five naturals | melds.naturalsBeforeWildAfterOpening |
5 |
0 |
MA2 |
| 10 | Sevens never take wilds; aces take wilds only in a mixed ace meld laid in the opening | melds.naturalOnlyRanks, melds.wildsOnlyInOpeningRanks |
["7"], ["A"] |
[], [] |
MA2 |
| 11 | A side’s wild meld may be begun short and grown, but while it is under seven cards no wild goes anywhere else | existing wildCanastas.mustBeLaidComplete; new wildCanastas.blocksOtherWilds |
false; true |
unchanged; false |
MA2 |
| 12 | Opening minimum 125 below 3000 (negative scores included), 155 to 4995, 180 from 5000 | existing initialMeld.minimums |
[{null,125},{3000,155},{5000,180}] |
unchanged | MA3 (data only) |
| 13 | The opening is made wholly from the hand: the pile’s top card counts for nothing, and the opening must be complete before the pile is taken | initialMeld.pileCardsCount gains none |
none |
topCardOnly |
MA3 |
| 14 | The opening must hold a pure meld of three naturals, or a wild meld (CLA: a pure meld only) | initialMeld.requires |
naturalOrWildMeld |
nothing |
MA3 |
| 15 | “Splash”: a complete natural or wild canasta from the hand opens with no minimum | initialMeld.canastaWaivesMinimum |
true |
false |
MA3 |
| 16 | The pile is taken only with a natural pair from the hand matching its top card; with an own meld of that rank of 3 or 4 cards, the three join it | existing discardPile |
alwaysFrozen: true, both other ways false |
unchanged | MA4 (data only) |
| 17 | Going out needs a final discard; two canastas to go out | existing goingOut.mustDiscard (no core enforces it yet), tables[].canastasToGoOut |
true, 2 |
false, unchanged |
MA4 |
| 18 | No wild discard, except the going-out discard or a hand of only wilds | discards.wild |
goingOutOrOnlyWilds |
allowed |
MA4 |
| 19 | On an empty pile no ace, seven or dead card may be discarded, unless nothing else can be | discards.onEmptyPile |
{ ranks: ["A","7"], dead: true } |
{ ranks: [], dead: false } |
MA4 |
| 20 | No upcard: the pile starts empty | deal.upcard |
none |
turned |
MA5 |
| 21 | Black threes are laid out and replaced like red threes, dealt or drawn; threes are never discarded | blackThrees.layOut |
true |
false |
MA5 |
| 22 | Threes score 100/300/500/1000 per colour; minus with no canasta, nothing with one, plus with two or more | redThrees.byCanastas; laid black threes score by the redThrees table, colour by colour |
byCanastas: true, each: 100, allTotals: [{2, 300}, {3, 500}, {4, 1000}], negativeWithoutMeld: false |
false, unchanged |
MA5 |
| 23 | A three drawn as the stock’s last card ends the hand and counts 5 against | stockEmpty gains a value |
lastThreeInHand |
handEndsWhenPlayerMustDraw |
MA5 |
| 24 | Bonus cards: the first side to open draws 4 after its discard, the second 3, while 9 or more cards are in the stock; an opening may then leave one card | initialMeld.bonusCards |
{ first: 4, second: 3, minStock: 9 } |
null |
MA6 |
| 25 | 13 cards each, 4 players only, 8500 to win | existing tables[] |
[{4, 2, 2, 13, 2, 8500}] |
unchanged | MA7 (data only) |
| 26 | Special hands: straight 3000, pairs 2500, pairs with twos, sevens and aces 2000, garbage 2000 | specialHands and a declare action |
Pagat’s four | [] |
MA8 (#222) |
Checkpoints
Each checkpoint follows .claude/workflows/canasta-checkpoint.js. The spec comes first: README
fields and rules, the field in every rule set, and scenarios using overrides. Then Swift, Kotlin
and Rust in the same PR, then review, then one PR. The behaviour suite and the Wasm build are run
in every PR. Apps change only where a checkpoint adds something to show.
| Checkpoint | Scope | State / protocol / save | Bots | Apps and strings |
|---|---|---|---|---|
| MA1. Scoring (#202) | Rows 1–5: rank bonuses, unfinished-meld and in-hand penalties, melds subtracted without a canasta. Penalties fold into the existing canastas, unfinishedCanastas, cardsInHand and melds rows |
None: no new score row, so the save format and the score sheet stay as they are | None (no rule set turns it on yet) | None |
| MA2. Melds capped at seven | Rows 6–11: seven-card cap, dead ranks, the rule of five, natural-only sevens, aces mixed only in the opening, a wild meld blocking wilds elsewhere | None | groupMelds, take selection and meldable marks respect the new checks |
New rule errors (meldFull, rankDead, wildNotYet, …) get en/es strings |
| MA3. The opening | Rows 12–15: the opening from the hand, the required pure (or wild) meld, the splash | None | Bot opening search respects them | Error strings |
| MA4. Discards and going out | Rows 16–19: mustDiscard enforced, wild and empty-pile discard limits, the “only alternative” exceptions |
None | Bot discard choice skips illegal discards | Error strings; the hand greys out cards that cannot be discarded |
| MA5. Threes and the empty start | Rows 20–23: no upcard, black threes laid out, threes scored by canastas, the last-card three. The three-ban joins the discard checks’ “another card that may be discarded” test (MA4), so a three in hand no longer counts as an alternative on an empty pile | seats[].blackThrees (save format version 2) |
Bots lay black threes | Black threes shown beside red ones; the score sheet row (open question 2) |
| MA6. Bonus cards and the turn card (#215) | Row 24: the talon of 4 or 3, taken into the hand at the next turn, its threes laid out; the “turn card” once 8 are left | seats[].bonusCards |
Bots open knowing the talon comes | A face-down talon beside the seat; a “Turn card drawn” notice |
| MA7. The rule set (#216) | spec/rulesets/modern-american.json (row 25 and every value above); bots.md for Modern American; seeded deals, bot games, a save, parity-long games, behaviour tests; the rule-set tests that expect a 6-player table in every rule set (coversTableSizes) check each rule set’s own tables instead |
Every loader lists the third rule set | Bot games pinned in parity/ and parity-long/ |
The rule set appears in every picker with an en/es name and summary; the docs site gets its rules page |
| MA8. Special hands (#222) | Row 26 as data (specialHands[]) with a declare action that ends the hand |
New action in protocol and saves | Bots recognise a special hand | A “Declare” action and its strings |
Why this order. MA1 needs nothing else, and it shows the method works: data in every rule set,
scenarios with overrides, three cores and no visible change. MA2 to MA4 tighten what is legal. Each
one adds rule errors and teaches the bots and the meldable marks. MA5 and MA6 change the game state,
so they come after the cheaper ones. MA7 turns everything on together and pins whole games, so a bug
in any of the earlier checkpoints shows up as a bot-game mismatch between the cores. MA8 comes
after MA7, as Eduardo decided (decision 6).
Testing with little UI testing. Every rule is pinned three times without a screen: scenarios run
by each core’s runner, the behaviour suite drives the three CLIs and the Wasm build, and from MA7
seeded bot games must match move by move across Swift, Kotlin and Rust. The apps only render what
the core’s GameScreen already decides (legal discards, meldable marks, the score rows), so the
only screen work is new elements: black threes, the talon, the turn-card notice and the new
strings. For those we use a web e2e check and a manual run on each app at MA5, MA6 and MA7.
Where the sources differ
| Point | Pagat (base) | CLA | Proposal |
|---|---|---|---|
| Opening’s required meld | A pure meld of 3, or a wild meld | A pure “clean triple”, not of a dead rank; never an unnatural canasta | initialMeld.requires: naturalOrWildMeld for Pagat; naturalMeld holds CLA’s |
| Taking the pile onto an existing meld | Needs a natural pair from hand, and the meld must hold 3 or 4 cards | The top card may simply be added to an existing meld | Pagat (pair always); takeByAddingToMeld already covers CLA’s |
| Incomplete aces, sevens or wild meld | Penalised; going out allowed (CLA’s rule listed as a table rule) | A side may not go out holding one | Pagat, plus a later goingOut.blockedByUnfinished setting if Eduardo wants CLA’s |
| A wild, ace, seven or dead card as the only discard on an empty pile | Discard it, and show the hand if asked | Take melded cards back until there is a legal discard | Pagat: CLA’s take-back would mean undoing moves, which the engine does not do |
| Special hands | Four | Eleven, two of them worth 8500 (they win the game) | Pagat’s four, as data, so more are just entries |
Decisions
Eduardo decided these on 2026-11-25.
- Pagat or the League? Pagat is the base and the rule set’s
source, as with Classic. Where the League is stricter, its rule becomes another value of the same setting where that is cheap (for exampleinitialMeld.requires: naturalMeld). - Saved games: black threes (MA5) and bonus cards (MA6) go in save format version 2. Every core already rejects unknown versions cleanly, and version 1 saves keep loading.
- Players: Modern American is offered only at four-player tables. Its
tableshas one entry, and the rule-set tests check each rule set’s owntables(MA7). - When players see it: only at MA7, once MA2 to MA6 are on main. Until then, no app offers the rule set.
- Score sheet rows: red and black threes share one row (open question 2). Eduardo decided
on 2026-11-25 that the row keeps its
redThreeskey in scores, the score sheet and saves, so no saved sheet changes, and that the apps label it by the rules: “Threes” (“Treses”) whereblackThrees.layOutis on, “Red 3s” (“3 rojos”) elsewhere, on the iPhone, Android and the web. MA5 (#214) writes version 2 only when a seat holds a laid black three, so everyofficialandfamilygame still saves as version 1. - Special hands: in (open question 1). MA8 is issue #222: Pagat’s four as data, a
declareaction, and the kept three with alayOutThreeaction to lay it out (Pagat: the player may lay it out whenever they no longer want it). Bots declare a hand they hold and lay a kept three out at once, since they never play toward a straight. Saves with either action are version 3. - A stronger Normal bot: MA7 ships with Normal beating Easy in 563 of 1,000 Modern American
games (660 in Official). A stronger Normal is follow-up issue #221 (open question 3): Normal
now reserves no pairs (keyed on
cardsInHandPenalties, standing in for hands that usually end with the stock run out), and wins 661 of 1,000. - Spanish name: “Canasta americana moderna”, in the apps, the site and the docs.
Open questions for Eduardo
- Special hands: decided, see decision 6.
- Score sheet rows: decided, see decision 5.
- A stronger Normal bot for Modern American? Decided: follow-up #221 (decision 7). At MA7 the
bots learnt the penalties (no short pure aces or sevens, no more than two of either in hand,
dead cards first, wilds melded since they cannot be discarded). Before that, a bot game could
run past 600 hands; now 1,000 seeded games end in at most 41. After the independent review, the
bots also skip a pile whose aces and sevens they could not discard in time, and Normal opens as
soon as it can. At MA7 Normal beat Easy in 563 of 1,000 games (660 in Official): its patience
(keeping five cards, two reserved pairs) suits Classic, not a game whose stock often runs out.
#221 dropped the reserved pairs where hands usually end with the stock run out (
spec/bots.md4.4), and Normal then beat Easy in 661 of 1,000 Modern American games (37 of 50). Special hands (MA8, #222) first dropped it to 618 of 1,000 (29 of 50): Easy’s sides declared 76 special hands and Normal’s 25, because Normal opens early and a side with a meld cannot declare. Normal now chases a special hand one card away (spec/bots.md 4.7) and beats Easy in 639 of 1,000 (28 of 50), declaring 136 to Easy’s 84. Eduardo set the Modern American 50-game floor to 27 (2026-11-25): 50 games are noisy, and the 1,000-game floor of 600 is the strength check.