Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

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

NameKindWhat it is
afterTurnfunctionWhose 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_RULESconstantBig Two as one CardGameRules: everything a table asks of the game.
bigTwoBeatsfunctionWhether a play beats the one on the table: the same number of cards, and stronger.
bigTwoCardfunctionA card's height in the whole pack, 0 (three of diamonds) to 51 (two of spades).
bigTwoChargefunctionWhat a hand left in is charged when somebody goes out: a point a card, double for ten or more, treble for thirteen or more.
bigTwoComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
BigTwoGametypeA GAME OF BIG TWO: its table and moves (what is kept), and the deal they have reached.
BigTwoKindtypeThe kinds of play in Big Two, a single to a straight flush.
bigTwoMayPlayfunctionWhether these cards may be played now by the seat to play.
bigTwoMovesfunctionEvery move the seat to play may make now; none once the game is over.
bigTwoPlaysfunctionEvery play this hand could make, each once, lowest cards first within a kind.
bigTwoRankfunctionA rank's height, the three lowest (0) and the two highest (12).
bigTwoValuefunctionWhat these cards are worth played together, or null for cards that make no play.
BigTwoValuetypeA play's kind and how strong it is among plays of the same number of cards.
bigTwoViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
BigTwoViewtypeWhat one seat can see of a game of Big Two: its own hand, the table, and what has been said and shown.
bigTwoWinnersfunctionThe fewest penalty points wins; level on the fewest shares it.
ClimbMovetypeCards played to beat the table (or lead), or a pass.
ClimbPlaytypeWhat is on the table: the last cards played to this trick, and whose they were.
ClimbTricktypeThe part of a climbing game's state the trick machinery moves: every climbing game carries these.
decodeBigTwofunctionText 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.
encodeBigTwofunctionA game of Big Two as text: its table, its seed and its moves, never a hand.
freshTrickfunctionA fresh trick to lead, for a new deal.
isClimbMovefunctionA move read back from storage, checked for shape: cards to play, or a pass.
laidfunctionThe trick after seat lays these cards on it: out of their hand, on the table, and seen by all.
nextRoundfunctionThe next seat round from from (not counting it) that wanted accepts, or null when none does.
passedOnfunctionThe trick after seat passes.
playBigTwofunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
seatsInfunctionThe seats still holding cards.
sortBigTwofunctionCards in Big Two's order, lowest first: how a hand is held.
startBigTwofunctionA 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.

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.