# Drawstep — Canasta: table model Generated from Drawstep's game registry (engine id `canasta`). Wiki page: https://drawstep.xyz/wiki/canasta · this document: https://drawstep.xyz/wiki/drawstep-canasta-ai-pack.md. Classic Canasta (pagat.com's rules) for two, three, four or six players, dealt by the classic-games engine from two packs and four jokers (three and six for six players). Four play in two partnerships, six in two teams of three, two and three each for themselves. Nobody brings a deck. The engine deals, lays out red threes and replaces them, freezes the discard pile (wild cards, a side that hasn't melded), checks every meld (two naturals, three wild cards at most, one meld per rank per side), the first meld's minimum (15 / 50 / 90 / 120 by the side's score), taking the pile, black threes, going out (a canasta — two with two or six players — concealed for double), the end of the stock and the score of every hand; the game goes to 5,000 by default. You see your own hand only; spectators see none. Hosts can seat easy, medium and hard bots. Tables are **enforced** only: the classic-games engine deals from two 52-card packs and four jokers (three packs and six jokers for six players) and runs every rule. Nobody brings a deck and there are no custom cards: a classic card is a plain id — `classic:AS` is the Ace of Spades, `classic:TH` the Ten of Hearts (ranks 2–9, T, J, Q, K, A; suits S, H, D, C); every joker is `classic:JOKER`. ## Classic Canasta — the rules the table runs The table plays **Classic Canasta** as pagat.com describes it (https://www.pagat.com/rummy/canasta.html), every rule enforced. **Players and sides.** Four players play in two partnerships, partners sitting opposite (seats 1 & 3 against 2 & 4). Six play in **two teams of three**, seated alternately (1, 3, 5 against 2, 4, 6) — one of pagat's two six-handed arrangements. Two or three players play **each for themselves** (pagat's three-handed game, where the first player to take the pile plays alone against a temporary partnership of the other two, is not offered). Partners share their melds and their red threes; a side's score is one score. **The cards.** Two 52-card packs and four jokers — 108 cards (six players: three packs and six jokers, 162). Jokers and twos are **wild**. Card values: joker 50; ace and two 20; king to eight 10; seven to four 5; black three 5. Red threes are bonus cards. **The deal.** The first dealer is drawn; the deal passes to the left after every hand. Each player gets **11 cards** with four players, **15** with two, **13** with three or six, one at a time from the dealer's left. The next card is turned up to start the discard pile; a wild card or a red three turned up is covered by another card and **freezes** the pile. Then every player lays out the red threes they were dealt and draws replacements from the stock. The player left of the dealer plays first; play goes to the left. **A turn.** Draw the top card of the stock (with two or three players: **the top two cards**; the host can turn this off) — or take the **whole discard pile** (below). Then meld if you want, and discard one card face up to end your turn. A red three you draw is laid out at once and replaced. **Melds.** Three or more cards of one rank (four to ace), with **at least two natural cards** and **at most three wild cards**. A side has one meld per rank: cards of a rank it has go onto that meld (yours or your partner's — never the opponents'). Seven cards or more make a **canasta**: **natural** (no wild card) or **mixed**. A canasta keeps growing; a wild card added to a natural canasta makes it mixed. Threes are never melded — except that a player who **goes out** may meld three or four **black threes** (no wild card) in that last turn. **The first meld.** A side's first meld of a hand must count at least a minimum, by the side's cumulative score: below 0 — **15**; 0 to 1,495 — **50**; 1,500 to 2,995 — **90**; 3,000 or more — **120** (six players: 7,000 or more — **150**). Several melds laid in the same move count together; red threes and canasta bonuses don't count. A side that takes the pile for its first meld counts the top card and cards from hand only — not the rest of the pile. The one exception: a player whose side has not melded may go out **concealed** in one turn (the whole hand melded, a canasta in it) without meeting the minimum. **Taking the discard pile.** You must meld its top card at once with cards from your hand: a **natural pair** of its rank, or — when the pile is not frozen for your side — one natural and a wild card, or by adding it to your side's meld of that rank. Then the rest of the pile goes into your hand (a red three in it is laid out, without a replacement), and you may meld more before you discard. Nobody can take the pile while a **wild card** or a **black three** is on top. **The frozen pile.** The pile is frozen for everyone while a wild card is in it (or a red three turned up at the deal) — the card lies crosswise — and for a side that has not made its first meld. A frozen pile can only be taken with a **natural pair** matching its top card (onto a meld of that rank, if the side has one). Taking the pile unfreezes it. **Black threes.** A black three on top of the pile stops the next player from taking it; once covered it has no effect (it does not freeze the pile). **Going out.** A side needs **one canasta** to go out (**two** with two players or six). You go out by melding all your cards, or all but one and discarding it — completing the canasta in the same turn is fine. Until your side may go out, you must keep a card after your discard. **Going out concealed** — your whole hand melded in one turn, with a canasta of your own, having melded nothing before (you may take the pile that turn, but not add to your partner's melds) — scores double. **“May I go out?”** At a partnership table (a host option, on by default), right after drawing or taking the pile and before melding anything else, you may ask your partner — the next one round the table — “May I go out?”. The answer binds: “yes”, and you must go out this turn; “no”, and you may not. You can ask only when your hand can go out, and with two cards at least. **The stock runs out.** Play goes on while players take the discard pile; with the stock empty a player **must** take the pile when it is not frozen and its top card goes onto a meld of their side. When a player can't or won't take it, the hand ends. A red three drawn as the stock's last card is laid out and the hand ends at once — the player neither melds nor discards. (With two cards drawn per turn, drawing only one card because the stock ran out counts as a complete draw.) **Scoring a hand.** Each side scores the values of all the cards it melded, **plus** 500 per natural canasta and 300 per mixed one, **plus** 100 per red three (**800** for all four; six players: four count 400, five 1,000, six 1,200) — **minus** the same if the side has not melded at all — **plus** 100 for going out (200 concealed), **minus** the values of the cards left in its players' hands. The scores add up from hand to hand; a negative score is possible. **The end.** The game ends after the hand in which a side reaches the **target score** (5,000 by default; the host sets it — pagat plays to 7,500 with three players and 10,000 with two teams of three). The highest score wins; sides tied at the top play another hand. A player who leaves ends the game: the best of the other sides wins (a partner loses with the player who left). **What you see.** Your own hand, every meld, the red threes, the stock's size, the pile's top card and size, whether it is frozen (and by which card) and every player's card count — and the score sheet with each side's first-meld minimum. At the end of a hand every hand is turned face up. Spectators see no hands (except at a table where only bots play). **Bots.** Hosts can seat bots (easy, medium, hard). They see only what their seat sees. They take the pile when it pays, make their side's first meld as soon as they reach the minimum, keep pairs to take a frozen pile with, complete the canastas their side needs with wild cards, avoid discarding what the next player can take the pile with (hard bots also freeze a big pile with a wild card), and go out when their side is ahead or the opponents are close to going out — asking their partner first when the partner holds many cards. ## Zones | Zone | Label | Kind | Visibility | Notes | |---|---|---|---|---| | `stock` | Stock | pile | hidden | ordered · shared | | `hand` | Hand | hand | owner | | | `melds` | Melds | row | public | | | `discard` | Discard pile | pile | public | ordered · shared | Hand zone: `hand` · library: `stock` · main surface: `melds` · discard: `discard`. Seats: 2 / 3 / 4 / 6. ## Counters - `score` — Score, starts at 0 (primary) ## Phases Draw → Meld & discard → Hand over ## Deck rules A deck list is `{ "name", "engine": "canasta", "format", "zones": { "": ["", …] } }`; copies are repeated ids. Formats: | Format | Zones (min–max, allowed types) | Max copies | Notes | |---|---|---|---| | Classic | | 1 | | ## Card adapter Types: Playing card · resource: Rank · stats: Rank · colors: Spades, Hearts, Diamonds, Clubs.