Reference
Big Two
import { … } from "@johnmorrisdotca/toranpu/big-two";
3.9 kB minified and gzipped, with everything it imports (measured with esbuild)
Big Two: its rules, its computer player and its saved-game format.
Exports
| Name | Kind | What it is |
|---|---|---|
afterTurn | function | Whose move it is after from played or passed: the next seat still in that has not passed, or — when nobody is left to answer — the trick cleared and led by whoever played last, or the next seat after them still in. |
BIG_TWO_RULES | constant | Big Two as one CardGameRules: everything a table asks of the game. |
bigTwoBeats | function | Whether a play beats the one on the table: the same number of cards, and stronger. |
bigTwoCard | function | A card's height in the whole pack, 0 (three of diamonds) to 51 (two of spades). |
bigTwoCharge | function | What a hand left in is charged when somebody goes out: a point a card, double for ten or more, treble for thirteen or more. |
bigTwoComputer | function | The move a computer in the seat to play makes: always one the rules allow. |
BigTwoGame | type | A GAME OF BIG TWO: its table and moves (what is kept), and the deal they have reached. |
BigTwoKind | type | The kinds of play in Big Two, a single to a straight flush. |
bigTwoMayPlay | function | Whether these cards may be played now by the seat to play. |
bigTwoMoves | function | Every move the seat to play may make now; none once the game is over. |
bigTwoPlays | function | Every play this hand could make, each once, lowest cards first within a kind. |
bigTwoRank | function | A rank's height, the three lowest (0) and the two highest (12). |
bigTwoValue | function | What these cards are worth played together, or null for cards that make no play. |
BigTwoValue | type | A play's kind and how strong it is among plays of the same number of cards. |
bigTwoView | function | The part of the game the seat to play can see, which is all its computer is given. |
BigTwoView | type | What one seat can see of a game of Big Two: its own hand, the table, and what has been said and shown. |
bigTwoWinners | function | The fewest penalty points wins; level on the fewest shares it. |
ClimbMove | type | Cards played to beat the table (or lead), or a pass. |
ClimbPlay | type | What is on the table: the last cards played to this trick, and whose they were. |
ClimbTrick | type | The part of a climbing game's state the trick machinery moves: every climbing game carries these. |
decodeBigTwo | function | Text read back into the game of Big Two it records, by playing every move again through the rules; null for anything they cannot play out. |
encodeBigTwo | function | A game of Big Two as text: its table, its seed and its moves, never a hand. |
freshTrick | function | A fresh trick to lead, for a new deal. |
isClimbMove | function | A move read back from storage, checked for shape: cards to play, or a pass. |
laid | function | The trick after seat lays these cards on it: out of their hand, on the table, and seen by all. |
nextRound | function | The next seat round from from (not counting it) that wanted accepts, or null when none does. |
passedOn | function | The trick after seat passes. |
playBigTwo | function | The game after that move, with the move added to its record, or null for a move the rules refuse. |
seatsIn | function | The seats still holding cards. |
sortBigTwo | function | Cards in Big Two's order, lowest first: how a hand is held. |
startBigTwo | function | A new game of Big Two for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Big Two is not offered for. |