Cardtype
A card as an object: its suit and its rank.
Every export of every entry point, each with its own page. This page keeps the addresses the old one-page reference had.
@johnmorrisdotca/toranpu/deckCardtypeA card as an object: its suit and its rank.
CARD_ALPHABETconstantThe fifty-two characters a card is written as, in deck order: spades A–K are A–M, hearts N–Z, diamonds a–m, clubs n–z.
cardAtfunctionThe card at a place in a fresh deck, 0 to 51.
cardCodefunctionOne character for a card (CARD_ALPHABET).
CardCodetypeA card as ONE character, A–Z then a–z (cardCode): a whole deck is a fifty-two-character string, so a deal travels in a saved game, an address and a move list without any separator to parse.
cardFromCodefunctionThe card a character names, or null for one that names none — a kept string is read, never trusted.
cardFromIdfunctionThe card a two-character id names, or null.
cardIdfunction"QS", "TH", "AC": the two-character id card players write, rank then suit, with T for the ten.
cardIndexfunctionThe card's place in a fresh deck, 0 to 51.
cardNamefunction"queen of hearts": the name a screen reader says.
cardShortNamefunction"Q♥": the short name a corner shows.
colourOffunctionA card's colour: red for hearts and diamonds, black for spades and clubs.
dealAllfunctionDeal the whole deck round the table: the first hands get one more where it does not divide evenly.
dealRoundfunctionDeal one card at a time round the table, as a dealer does: hands hands of each cards, dealt from the top (the start of the array), and what is left.
DECK_SIZEconstantHow many cards a deck holds: fifty-two.
freshDeckfunctionA fresh deck in the order a new pack is sorted: spades ace to king, then hearts, diamonds, clubs.
isRedfunctionWhether a card is a heart or a diamond.
isWholeDeckfunctionWhether a string is a whole deck: fifty-two cards, each exactly once.
RandomtypeA number in [0, 1), like Math.random, from a stream a seed fixes.
RanktypeAce is 1 and King 13.
RANK_DISPLAYconstantHow each rank is written: short (A, 10, K) and as a word (ace, ten, king).
RankDisplaytypeHow a rank is written: A, 2…10, J, Q, K, and in a sentence.
RANKSconstantThe ranks in order, ace low: 1 (the ace) to 13 (the king).
readCardsfunctionA string of card characters read back, or null if any character names no card.
sameCardfunctionWhether two card objects are the same card.
seededRandomfunctionA stream of numbers in [0, 1) fixed by a seed.
shuffledfunctionA copy of the list in a random order (Fisher–Yates); the list given is left alone.
shuffledDeckfunctionA deck shuffled from a seed: the same seed, the same order, in every browser and every test.
sortedHandfunctionA hand sorted by suit (the fresh-deck order) and then by rank: how a player arranges one.
SuittypeOne of the four suits, by name.
SUIT_DISPLAYconstantHow each suit is written and drawn: its symbol, its name and its colour.
SuitColourtypeA suit's colour, which Klondike's alternating runs and Crazy Eights' matches both read.
SuitDisplaytypeHow a suit is written and drawn.
SUITSconstantThe suits in the order a fresh deck is sorted and a foundation row is laid out: spades, hearts, diamonds, clubs — black, red, red, black, so no two neighbours on a row of four look alike.
takefunctionTake count from the top: what was taken, and what is left.
writeCardsfunctionA run of cards as a string, one character each.
@johnmorrisdotca/toranpu/reactCardGameStatetypeA card game in React state: the game, the moves the person to play may make, and play to make one.
useCardGamefunctionA card game held in React state.
@johnmorrisdotca/toranpu/card-soundsCARD_SOUND_KINDSconstantEvery kind of sound, in the order a game meets them.
CardSoundDatatypeThe recordings, by name (deal-2), as base64 AAC.
CardSoundKindtypeOne kind of sound: deal a card sent to a hand, flip a card turned over, play a card laid on the table, shuffle the deck shuffled, gather a pile swept in, fan a hand spread open.
CardSoundstypeA table's sounds: play one, mute and unmute, change the volume, close when the table goes.
CardSoundsOptionstypeHow a table's sounds are made.
CardSoundWindowtypeThe parts of a window the sounds use: an audio context and atob.
createCardSoundsfunctionA table's card sounds.
MOST_SOUNDS_AT_ONCEconstantAs many sounds as one call plays: thirteen cards dealt are eight slides, not a wall of noise.
PlayCardSoundOptionstypeHow one sound is played.
soundTimesfunctionWhen each of count sounds starts, in milliseconds from the first: one every gap, and no more than MOST_SOUNDS_AT_ONCE, spread over the same time.
@johnmorrisdotca/toranpu/soundsCARD_SOUND_DATAconstantThe card sounds, recorded: cards dealt, turned over, played, shuffled, gathered and fanned, as base64 AAC (.m4a).
CardSoundFiletypeThe name of one recording: its kind of sound and a number, such as deal-2.
@johnmorrisdotca/toranpu/card-backsCARD_BACK_LOOKconstantEach back's own colours: its field, the lines and dots drawn on the field, and the paper round it.
CARD_BACK_PROPERTIESconstantThe CSS custom properties a back drawn into a page takes its colours from, when no colour is given.
CARD_BACKSconstantThe backs, by name.
CARD_BOXconstantA card is drawn in a box 100 wide and 140 tall, the 5:7 of a poker-size card, and scales to any width.
CardBackNametypeOne back's name.
cardBackNamesfunctionThe backs a page may ask for by name: the package's own, and any the page registered (registerCardBack).
CardBackOptionstypeHow a back is drawn.
cardBackSvgfunctionA back as a whole SVG document, 100 by 140.
cardBackUrlfunctionA back as a data URL, for an <img src>, a CSS background or a canvas: the same drawing as cardBackSvg, with its own colours.
CardSuitLettertypeA suit as one letter, as a card's id writes it: spades, hearts, diamonds, clubs.
registerCardBackfunctionKeep a back by its name.
RegisteredCardBacktypeA back registered by name: how it is drawn, and the built-in back it starts from.
registeredCardBacksfunctionThe names of the backs registered now, in the order they were.
SUIT_PATHSconstantThe four suits, each a path in a box of 100 filled in one colour.
unregisterCardBackfunctionForget a registered back.
@johnmorrisdotca/toranpu/card-facesCARD_DESIGNSconstantThe designs drawn here, by name.
CARD_FACE_COLOURSconstantThe faces' own colours.
CARD_FACE_PROPERTIESconstantThe CSS custom properties a plain or four-colour face drawn into a page takes its colours from.
CardDesigntypeA set of drawn cards: its name, the box each card is drawn in, and each card's drawing (what goes inside an <svg> of that box) by its id, KS for the king of spades and RJ and BJ for the red and black jokers.
CardDesignNametypeA design's name.
cardFaceFromArtfunctionA card's face from artwork of your own: art is SVG markup (or a whole <svg> document) drawn on the card's paper in a box 100 by 140, or in box, fitted to the card's height and centred; a whole <svg> is used as it is.
CardFaceOptionstypeHow a face is drawn.
cardFaceSvgfunctionA card's face as a whole SVG document, 100 by 140: QS, TD, a joker (RJ, BJ), a rules card (R1, R2) or the blank (BL).
cardFaceUrlfunctionA card's face as a data URL, for an <img src>, a CSS background or a canvas.
cleanMarkupfunctionSVG markup with what could run or fetch taken out: scripts, foreignObject, frames, animation elements and styles, every on… handler, and any href that is not a picture or a #fragment of the drawing itself.
CUSTOM_CARD_IDconstantWhat a card's id may be, when a design of the page draws it: letters and digits, with -, _, . and : inside, up to 40.
EXTRA_CARDSconstantTHE EXTRAS OF A REAL DECK, which no game here deals but a hand on a page may hold, as a wild card or for the look of it: the two jokers, the two rules cards a pack is sold with (R1, the rules of Hearts; R2, of Spades), and a blank (BL).
EXTRA_LIMITSconstantThe most of each kind of extra one hand holds: four jokers, as some packs have; two rules cards; two blanks.
faceNamefunctionA face's name in words: "queen of spades", "red joker"; in Japanese "スペードのクイーン", "赤のジョーカー".
isCardFacefunctionWhether a text is a card a face can be drawn for: QS, TD, a joker (RJ, BJ), a rules card (R1, R2) or the blank (BL).
JOKERSconstantThe two jokers' ids: the red joker and the black.
loadCardDesignfunctionA design by its name, loaded when it is first asked for: "english" fetches the English pattern (about 700 kB, 200 kB compressed) only then.
pipPlacesfunctionThe middles of a number card's pips, in the 100 by 140 box, and whether each is drawn upside down.
registerCardDesignfunctionKeep a design by its name, in place of any earlier one of that name.
registeredCardDesignsfunctionThe names of the designs registered now, in the order they were.
safeImageUrlfunctionA picture's address, or null when it is anything else.
unregisterCardDesignfunctionForget a registered design.
@johnmorrisdotca/toranpu/card-faces/englishENGLISH_PATTERNconstantThe English pattern, every card and two jokers, drawn in a box 360 by 540.
@johnmorrisdotca/toranpu/card-faces/realisticREALISTICconstantThe realistic design: Knoll's 39 cards in a box 167.0869141 by 242.6669922, and Fomin's English pattern for every other card.
@johnmorrisdotca/toranpu/elementarrangeCardsfunctionA hand laid out another way, as a new list (the one given is left alone): "rank" sorts it low to high, the ace high, a rank's cards in suit order; "suit" groups it by suit, spades, hearts, clubs, diamonds, each in rank order; "face" groups it into the number cards, ace to ten, and then the face cards, jack, queen, king, each group in rank order and a rank's cards in suit order; "dealt" keeps the order given.
BUNDLE_BACKSconstantHow many backs a squared-up bundle shows, whatever the hand: a bundle never tells how many cards are in it.
CardFaceContexttypeWhat a card's face function is told: the language the card speaks, and the design it names.
CardFaceRenderertypeA function that draws a card's face: given the card's id and its context, SVG markup (drawn on the card's paper in a box 100 by 140, or a whole <svg> document), or an element, or null to draw the card as its design does.
CardLandstypeWhere a card a hand is given goes: to the front, or the end.
CardOrdertypeHow a hand's cards are laid out: as they were dealt, by rank, grouped by suit, or the number cards apart from the face cards.
CardPlacetypeOne card's place: across and down in card widths from where the first lies, and its turn in degrees.
defineHandfunctionRegister a hand under its standard tag or a host-supplied tag.
defineToranpuElementsfunctionRegister the elements under their tags, once; a tag already taken is left as it is.
ELEMENT_SIZESconstantThe sizes every element takes, as a card's width in pixels.
handLayoutfunctionWhere each card of a hand of count lies: a fan when open, a squared-up stack with a sliver of each card showing when closed, and every shape in between.
HandLayoutOptionstypeHow a hand is laid out.
HandTurnOptionstypeHow a hand's cards are turned face down or face up.
mixCardsfunctionA hand mixed up, as a new list: the same cards in another order, never the order given (where a hand has two cards or more that differ), so a mix is always seen to change something.
partedHandLayoutfunctionA HAND PARTED AT ONE CARD: that card lifted a little, upright and wholly in view, and the cards to its left and right drawn apart from it into a group on each side (one group where it is the first or the last).
PartOptionstypeHow a parted hand is laid out.
pileLayoutfunctionWhere each card of a pile of count lies, bottom first, the top card last: at 0 messiness a neat stack whose edge shows a card's thickness for each card under the top, and towards 1 a heap, each card nudged and turned a little more.
PileLayoutOptionstypeHow a pile is laid out.
readHandfunctionA hand written as text, as its cards: the two-letter ids separated by spaces or commas ("AS KH 10D TC RJ", with 10 for ten as well as T), or the deck's one-letter codes run together ("pvOZ").
registerCardBackfunctionKeep a back by its name.
registerCardDesignfunctionKeep a design by its name, in place of any earlier one of that name.
replaceCardfunctionA hand with one card tossed out and another given in its stead, at the front or the end: as a new list.
SpinOptionstypeHow a card is spun.
TORANPU_TAGSconstantThe elements' tags.
ToranpuCardclassONE CARD ON ANY PAGE: <toranpu-card card="QS">, in any design and with any back, face up or face down, turned over by a tap when it has flip.
ToranpuHandclassA HAND OF CARDS ON ANY PAGE: <toranpu-hand cards="AS KH QD">, fanned, in any design and with any back.
ToranpuPileclassA PILE OF CARDS ON ANY PAGE: <toranpu-pile>, a stock to draw from or a discard pile, its top card on top and the cards under it showing as a stack, from neatly squared to very messy.
tossCardfunctionA hand without one card, as a new list: the first of that card taken out, or the hand unchanged where it holds none.
@johnmorrisdotca/toranpu/element/definearrangeCardsfunctionA hand laid out another way, as a new list (the one given is left alone): "rank" sorts it low to high, the ace high, a rank's cards in suit order; "suit" groups it by suit, spades, hearts, clubs, diamonds, each in rank order; "face" groups it into the number cards, ace to ten, and then the face cards, jack, queen, king, each group in rank order and a rank's cards in suit order; "dealt" keeps the order given.
BUNDLE_BACKSconstantHow many backs a squared-up bundle shows, whatever the hand: a bundle never tells how many cards are in it.
CardFaceContexttypeWhat a card's face function is told: the language the card speaks, and the design it names.
CardFaceRenderertypeA function that draws a card's face: given the card's id and its context, SVG markup (drawn on the card's paper in a box 100 by 140, or a whole <svg> document), or an element, or null to draw the card as its design does.
CardLandstypeWhere a card a hand is given goes: to the front, or the end.
CardOrdertypeHow a hand's cards are laid out: as they were dealt, by rank, grouped by suit, or the number cards apart from the face cards.
CardPlacetypeOne card's place: across and down in card widths from where the first lies, and its turn in degrees.
defineHandfunctionRegister a hand under its standard tag or a host-supplied tag.
defineToranpuElementsfunctionRegister the elements under their tags, once; a tag already taken is left as it is.
ELEMENT_SIZESconstantThe sizes every element takes, as a card's width in pixels.
handLayoutfunctionWhere each card of a hand of count lies: a fan when open, a squared-up stack with a sliver of each card showing when closed, and every shape in between.
HandLayoutOptionstypeHow a hand is laid out.
HandTurnOptionstypeHow a hand's cards are turned face down or face up.
mixCardsfunctionA hand mixed up, as a new list: the same cards in another order, never the order given (where a hand has two cards or more that differ), so a mix is always seen to change something.
partedHandLayoutfunctionA HAND PARTED AT ONE CARD: that card lifted a little, upright and wholly in view, and the cards to its left and right drawn apart from it into a group on each side (one group where it is the first or the last).
PartOptionstypeHow a parted hand is laid out.
pileLayoutfunctionWhere each card of a pile of count lies, bottom first, the top card last: at 0 messiness a neat stack whose edge shows a card's thickness for each card under the top, and towards 1 a heap, each card nudged and turned a little more.
PileLayoutOptionstypeHow a pile is laid out.
readHandfunctionA hand written as text, as its cards: the two-letter ids separated by spaces or commas ("AS KH 10D TC RJ", with 10 for ten as well as T), or the deck's one-letter codes run together ("pvOZ").
registerCardBackfunctionKeep a back by its name.
registerCardDesignfunctionKeep a design by its name, in place of any earlier one of that name.
replaceCardfunctionA hand with one card tossed out and another given in its stead, at the front or the end: as a new list.
SpinOptionstypeHow a card is spun.
TORANPU_TAGSconstantThe elements' tags.
ToranpuCardclassONE CARD ON ANY PAGE: <toranpu-card card="QS">, in any design and with any back, face up or face down, turned over by a tap when it has flip.
ToranpuHandclassA HAND OF CARDS ON ANY PAGE: <toranpu-hand cards="AS KH QD">, fanned, in any design and with any back.
ToranpuPileclassA PILE OF CARDS ON ANY PAGE: <toranpu-pile>, a stock to draw from or a discard pile, its top card on top and the cards under it showing as a stack, from neatly squared to very messy.
tossCardfunctionA hand without one card, as a new list: the first of that card taken out, or the hand unchanged where it holds none.
@johnmorrisdotca/toranpu/tabledefineToranpuTablefunctionRegisters <toranpu-table>, and the card, hand and pile elements, once.
TABLE_CLOTHSconstantTHE CLOTHS A TABLE MAY BE LAID IN: the same five the whole family offers, and itsutsu.com's boards.
TableClothtypeA cloth's name.
ToranpuTableclass<toranpu-table>: ANY OF THE ELEVEN GAMES, READY TO PLAY.
@johnmorrisdotca/toranpu/table/definedefineToranpuTablefunctionRegisters <toranpu-table>, and the card, hand and pile elements, once.
TABLE_CLOTHSconstantTHE CLOTHS A TABLE MAY BE LAID IN: the same five the whole family offers, and itsutsu.com's boards.
TableClothtypeA cloth's name.
ToranpuTableclass<toranpu-table>: ANY OF THE ELEVEN GAMES, READY TO PLAY.
@johnmorrisdotca/toranpu/heartschoosePassfunctionThe three cards a computer passes from a hand of Hearts: the queen of spades and the high spades that catch her, high hearts, and cards from a short suit.
decodeHeartsfunctionText read back into the game of Hearts it records, by playing every move again through the rules; null for anything they cannot play out.
encodeHeartsfunctionA game of Hearts as text: its table, its seed and its moves, never a hand.
HEARTS_ALL_POINTSconstantEvery point in a deal: thirteen hearts and the queen.
HEARTS_RULESconstantHearts as one CardGameRules: everything a table asks of the game.
heartsComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
HeartsGametypeA GAME OF HEARTS: its table and moves (what is kept, KeptCardGame), and everything the moves make, read again from them whenever the game is.
heartsHeightfunctionA card's height in a trick: ace high.
HeartsMovetypeThree cards passed (all three at once, as a player hands them over), or one card played to the trick.
heartsMovesfunctionEvery move the seat to play may make now; none once the game is over.
HeartsPhasetypePassing three cards before the deal is played, playing it out trick by trick, or the game over.
HeartsPlaytypeOne card laid on a trick, and whose it was.
heartsPlayablefunctionThe cards the seat to play may lay on the trick now.
heartsPointsfunctionA card's points: a heart one, the queen of spades thirteen.
heartsViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
HeartsViewtypeWhat the seat to move can see: its own hand and the table.
heartsWinnersfunctionThe lowest score wins; level on the lowest shares it.
passOffsetfunctionHow far round the table the cards go this deal: 1 to the left, seats − 1 to the right, 2 across, 0 held.
playHeartsfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
QUEEN_OF_SPADESconstantThe queen of spades, worth thirteen points to whoever takes her.
sortHeartsfunctionA hand sorted as a player holds it: clubs, diamonds, spades, hearts, low to high within each.
startHeartsfunctionA new game of Hearts for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Hearts is not offered for.
trickWinnerfunctionWho takes a finished trick: the highest card of the suit led.
TWO_OF_CLUBSconstantThe two of clubs, which leads the first trick of every deal.
@johnmorrisdotca/toranpu/spadeschooseBidfunctionNil for a hand of nothing (and never beside a partner's nil); otherwise what the hand is worth, at least one.
contractOffunctionA partnership's contract this deal: its bids added, a nil counting none; null while either has still to bid.
dealerOffunctionThe seat that deals this deal: the first seat, then round to the left.
decodeSpadesfunctionText read back into the game of Spades it records, by playing every move again through the rules; null for anything they cannot play out.
encodeSpadesfunctionA game of Spades as text: its table, its seed and its moves, never a hand.
handWorthfunctionThe tricks a hand is worth, counted as a card player counts them before bidding.
NILconstantThe bid that means no tricks at all.
partnerOffunctionThe seat across the table.
partnershipScorefunctionWhat one partnership made of a deal: its contract (the two bids, a nil counting none) made or not, each nil made or not, and the overtricks — the tricks over the contract, and any trick a nil bidder took — as bags.
playSpadesfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
sortSpadesfunctionA hand sorted as a player holds it: diamonds, clubs, hearts, spades, low to high within each.
SPADES_BIDSconstantThe bids open to a player: nil, or one to thirteen tricks.
SPADES_RULESconstantSpades as one CardGameRules: everything a table asks of the game.
SPADES_SEATSconstantHow many play Spades: four, in two partnerships.
SPADES_TRICKSconstantThe tricks in a deal of Spades: thirteen.
spadesComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
SpadesDealScoretypeWhat one finished deal did to a partnership's score, as the scores table explains it.
SpadesGametypeA GAME OF SPADES: its table and moves (what is kept, KeptCardGame), and everything the moves make, read again from them whenever the game is.
spadesHeightfunctionA card's height in a trick: ace high.
SpadesMovetypeA bid of tricks, 0 (nil) to 13, or one card played to the trick.
spadesMovesfunctionEvery move the seat to play may make now; none once the game is over.
SpadesPhasetypeBidding how many tricks each seat will take, playing the deal out trick by trick, or the game over.
SpadesPlaytypeOne card laid on a trick, and whose it was.
spadesPlayablefunctionThe cards the seat to play may lay on the trick now.
spadesTrickWinnerfunctionWho takes a finished trick (or is winning one still being played): the highest spade, or else the highest card of the suit led.
spadesViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
SpadesViewtypeWhat the seat to move can see: its own hand, every bid, the tricks taken and the cards played.
spadesWinnersfunctionThe partnership with the higher score wins, both its seats.
startSpadesfunctionA new game of Spades for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Spades is not offered for.
teamOffunctionA seat's partnership: 0 for seats 0 and 2, 1 for seats 1 and 3.
@johnmorrisdotca/toranpu/euchredealerOffunctionThe seat that deals this hand: the first seat, then round to the left.
decodeEuchrefunctionText read back into the game of Euchre it records, by playing every move again through the rules; null for anything they cannot play out.
encodeEuchrefunctionA game of Euchre as text: its table, its seed and its moves, never a hand.
EUCHRE_DECKconstantThe cards Euchre is played with: nine to ace of each suit.
EUCHRE_RULESconstantEuchre as one CardGameRules: everything a table asks of the game.
EUCHRE_SEATSconstantHow many play Euchre: four, in two partnerships.
euchreComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
EuchreGametypeA GAME OF EUCHRE: its table and moves (what is kept, KeptCardGame), and everything the moves make.
EuchreHandScoretypeWhat one hand did: which partnership made trumps, the tricks it took, and the points each partnership scored.
euchreHeightfunctionA card's height within its suit as the hand is played: ace high; in trumps the right bower, then the left, above everything.
EuchreMovetypeOrdering up the card turned up, or passing; naming another suit, or passing; the dealer throwing a card after picking the turned one up; or a card played to the trick.
euchreMovesfunctionEvery move the seat to play may make now; none once the game is over.
EuchrePhasetypeThe first round of the making (take the turned card's suit, or pass), the second (name another suit, or pass — the dealer may not), the dealer's discard, the tricks, or the game over.
EuchrePlaytypeOne card laid, and whose it was.
euchrePlayablefunctionThe cards the seat to play may lay on the trick: the suit led (the left bower counting as a trump) if it holds any.
euchreTrickWinnerfunctionWho is taking a trick: the highest trump, or else the highest card of the suit led.
euchreViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
EuchreViewtypeA COMPUTER AT THE EUCHRE TABLE.
euchreWinnersfunctionThe partnership with the higher score wins, both its seats.
handPointsfunctionWhat a hand scores: one to the makers for three or four tricks, two for all five, and two to the other side when the makers take two or fewer.
partnerOffunctionThe seat across the table.
playEuchrefunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
sameColourfunctionThe suit of the same colour: clubs and spades, diamonds and hearts.
sortEuchrefunctionA hand sorted as a player holds it: by suit (trumps last once made), high cards to the right.
startEuchrefunctionA new game of Euchre for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Euchre is not offered for.
suitInfunctionThe suit a card belongs to once trumps are made: the left bower is a trump.
teamOffunctionA seat's partnership: 0 for seats 0 and 2, 1 for seats 1 and 3.
throwAwayfunctionAfter picking the turned card up: the lowest card outside trumps, from the shortest suit, never an ace.
trumpWorthfunctionHow much a hand is worth with this suit as trumps, roughly in tricks.
@johnmorrisdotca/toranpu/cribbagecardValuefunctionA card's worth in the count: ace one, court cards ten.
chooseCribfunctionThe two cards to lay away: the four kept worth most on average with every starter, the crib counted for or against.
choosePegfunctionThe card to peg: most points now, then a count kept off five and twenty-one, a low lead that is not a five.
CRIBBAGE_RULESconstantCribbage as one CardGameRules: everything a table asks of the game.
CRIBBAGE_SEATSconstantHow many play Cribbage here: two.
cribbageComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
CribbageCounttypeWhat a hand's show is worth, by kind.
CribbageGametypeA GAME OF CRIBBAGE: its table and moves (what is kept, KeptCardGame), and everything the moves make, read again from them whenever the game is.
CribbageHandScoretypeOne hand as it was shown: the dealer, the starter, both four-card hands and the crib, and what each counted.
CribbageMovetypeTwo cards laid away to the crib, or one card played in the pegging.
cribbageMovesfunctionEvery move the seat to play may make now; none once the game is over.
CribbagePegtypeWhat one card played in the pegging scored, and why: "fifteen", "a pair", "a run of three", "go", "last card", "thirty-one".
CribbagePhasetypeBoth players laying two cards to the crib, the pegging, or the game over.
CribbagePlaytypeOne card laid, and whose it was.
cribbagePlayablefunctionThe cards a seat may play on the count now: any that keeps it to thirty-one.
cribbageViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
CribbageViewtypeA COMPUTER AT THE CRIBBAGE TABLE.
cribbageWinnersfunctionThe first to the total.
cribPairsfunctionEvery way to lay two of a hand away.
dealerOffunctionThe seat that deals this hand: the first seat, then the other, turn about.
decodeCribbagefunctionText read back into the game of Cribbage it records, by playing every move again through the rules; null for anything they cannot play out.
encodeCribbagefunctionA game of Cribbage as text: its table, its seed and its moves, never a hand.
otherOffunctionThe seat that is not this one.
pegPointsfunctionWhat laying the last card of cards scores, the count now count: fifteen, thirty-one, pairs and runs.
playCribbagefunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
showCountfunctionWhat four cards and the starter are worth in the show.
sortCribbagefunctionA hand sorted as a player holds it: ace low to king, by rank then suit.
startCribbagefunctionA new game of Cribbage for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Cribbage is not offered for.
throwWorthfunctionWhat two cards thrown to a crib are worth to it, roughly: a pair, a fifteen, fives, and cards close enough to run.
@johnmorrisdotca/toranpu/oh-hellchooseOhHellBidfunctionThe bid nearest what the hand is worth, among those allowed.
dealerOffunctionThe seat that deals this deal: the first seat, then round to the left.
dealPointsfunctionWhat a seat scores for a deal: ten and its bid for exactly what it bid, nothing otherwise.
dealSizesfunctionThe cards dealt to each seat in each deal of a game of this length: up to seven, and back down in the long game.
decodeOhHellfunctionText read back into the game of Oh Hell it records, by playing every move again through the rules; null for anything they cannot play out.
encodeOhHellfunctionA game of Oh Hell as text: its table, its seed and its moves, never a hand.
OH_HELL_MOST_CARDSconstantThe most cards dealt to a hand of Oh Hell: seven.
OH_HELL_RULESconstantOh Hell as one CardGameRules: everything a table asks of the game.
ohHellBidsfunctionThe bids open to the seat to bid: nought to the cards in hand, less the one a dealer may not make.
ohHellComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
OhHellDealScoretypeWhat one finished deal did: each seat's bid, the tricks it took, and what it scored.
OhHellGametypeA GAME OF OH HELL: its table and moves (what is kept, KeptCardGame), and everything the moves make.
ohHellHeightfunctionA card's height in a trick: ace high.
OhHellMovetypeA bid of tricks, nought up to the cards in hand, or one card played to the trick.
ohHellMovesfunctionEvery move the seat to play may make now; none once the game is over.
OhHellPhasetypeBidding the exact number of tricks each seat will take, playing the deal out, or the game over.
OhHellPlaytypeOne card laid, and whose it was.
ohHellPlayablefunctionThe cards the seat to play may lay: the suit led if it holds any.
ohHellTrickWinnerfunctionWho takes a trick: the highest trump, or else the highest card of the suit led.
ohHellViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
OhHellViewtypeA COMPUTER AT THE OH HELL TABLE.
ohHellWinnersfunctionThe highest score after the last deal: every seat that has it.
ohHellWorthfunctionThe tricks a hand should take with these trumps, roughly.
playOhHellfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
sortOhHellfunctionA hand as a player holds it: by suit, trumps last, high cards to the right.
startOhHellfunctionA new game of Oh Hell for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Oh Hell is not offered for.
@johnmorrisdotca/toranpu/crazy-eightsCRAZY_EIGHTS_RULESconstantCrazy Eights as one CardGameRules: everything a table asks of the game.
crazyEightsComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
CrazyEightsGametypeA GAME OF CRAZY EIGHTS: its table and moves (what is kept), and the hand they have reached.
CrazyEightsMovetypeA card played (an eight names the suit to follow), a card drawn from the stock, or a turn passed.
crazyEightsMovesfunctionEvery move the seat to play may make now; none once the game is over.
CrazyEightsResulttypeHow a hand ended: who won it, and the points each winner took.
crazyEightsViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
CrazyEightsViewtypeWhat one seat can see of a game of Crazy Eights: its own hand, the table, and what has been said and shown.
crazyEightsWinnersfunctionThe highest score wins, once somebody reaches the game's size; level on it shares the win.
crazyHandSizefunctionSeven cards each for two players, five for more.
crazyMatchesfunctionWhether this card may go on the pile now: an eight always; otherwise the suit to follow or the top card's rank.
crazyPlayablefunctionThe cards the player to move may play now: after drawing, only the card drawn.
crazyPointsfunctionWhat a card left in hand is worth to the winner of the hand.
crazyTopfunctionThe card on top of the discard pile.
decodeCrazyEightsfunctionText read back into the game of Crazy Eights it records, by playing every move again through the rules; null for anything they cannot play out.
EIGHTconstantThe rank that is wild in Crazy Eights.
encodeCrazyEightsfunctionA game of Crazy Eights as text: its table, its seed and its moves, never a hand.
longestSuitfunctionThe suit this hand holds most of, eights aside; clubs first among equals so the choice is always the same.
playCrazyEightsfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
sortCrazyfunctionA hand as a player holds it: eights last, the rest by suit and rank.
startCrazyEightsfunctionA new game of Crazy Eights for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Crazy Eights is not offered for.
@johnmorrisdotca/toranpu/go-fishdecodeGoFishfunctionText read back into the game of Go Fish it records, by playing every move again through the rules; null for anything they cannot play out.
encodeGoFishfunctionA game of Go Fish as text: its table, its seed and its moves, never a hand.
GO_FISH_RULESconstantGo Fish as one CardGameRules: everything a table asks of the game.
goFishComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
GoFishEventtypeWhat the whole table saw of a turn: who asked whom for what, how many cards were handed over, and — when none were — whether the card drawn from the pond was the rank asked for (which is shown, and earns another ask).
GoFishGametypeA GAME OF GO FISH: its table and moves (what is kept), and what they make.
goFishHandSizefunctionSeven cards each for two or three players, five for more.
goFishMemoryfunctionWhat the table's log says about every seat's hand, worked out from the asks, the answers and the books.
GoFishMemorytypeWhat the table has said about each seat's hand: for each seat, the ranks it is known to hold and known to be without.
GoFishMovetypeAsking one player for every card they hold of one rank.
goFishMovesfunctionEvery move the seat to play may make now; none once the game is over.
goFishRanksfunctionThe ranks the seat to move may ask for: those it holds.
goFishTargetsfunctionThe players the seat to move may ask: everybody else holding cards, or, when nobody else does, anybody else.
goFishViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
GoFishViewtypeWhat one seat can see of a game of Go Fish: its own hand, the table, and what has been said and shown.
goFishWinnersfunctionThe most books wins; level on the most shares it.
playGoFishfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
sortGoFishfunctionA hand as a player holds it: grouped by rank, ace to king.
startGoFishfunctionA new game of Go Fish for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Go Fish is not offered for.
@johnmorrisdotca/toranpu/big-twoafterTurnfunctionWhose 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.
@johnmorrisdotca/toranpu/presidentafterTurnfunctionWhose 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.
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.
decodePresidentfunctionText read back into the game of President it records, by playing every move again through the rules; null for anything they cannot play out.
encodePresidentfunctionA game of President 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.
playPresidentfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
PRESIDENT_RULESconstantPresident as one CardGameRules: everything a table asks of the game.
presidentComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
PresidentGametypeA GAME OF PRESIDENT: its table and moves (what is kept), and the round they have reached.
presidentMayPlayfunctionWhether these cards may be played now by the seat to play: one rank, one to four of it, higher than the table's and as many.
PresidentMovetypeA climbing move, or the cards a President or Vice-President hands back down at the start of a round.
presidentMovesfunctionEvery move the seat to play may make now; none once the game is over.
presidentRankfunctionA rank's height: the three lowest (0), the two highest (12).
PresidentSwaptypeCards handed over at the start of a round: the best cards up, whatever the receiver chooses back down.
presidentSwapCountfunctionHow many cards the President and the Beggar swap: two, or one when only three are at the table.
presidentTitlefunctionA seat's title from a round's finishing order.
PresidentTitletypeEach seat's title from a round's finishing order: 0 President, 1 Vice-President, the last two Vice-Beggar and Beggar, everybody else a Citizen.
presidentViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
PresidentViewtypeWhat one seat can see of a game of President: its own hand, the table, and what has been said and shown.
presidentWinnersfunctionThe most points wins; level on the most shares it.
seatsInfunctionThe seats still holding cards.
sortPresidentfunctionCards in President's order, lowest first, suits in a fixed order only so a hand always sorts the same way.
startPresidentfunctionA new game of President for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table President is not offered for.
@johnmorrisdotca/toranpu/gin-rummybestLayoutfunctionThe hand laid out to leave the least deadwood: the melds chosen, none sharing a card, and what is left.
canKnockWithfunctionWhether throwing this card, from a hand of eleven, leaves little enough deadwood to knock with.
chooseThrowfunctionThe card to throw: the one leaving the least deadwood; of those, not a card the other player could use, and the highest.
deadwoodInfunctionThe deadwood left in a hand at its best.
deadwoodOffunctionWhat a list of cards counts as deadwood, added up.
deadwoodValuefunctionA card's deadwood: an ace one, the numbers their number, a jack, queen or king ten.
decodeGinfunctionText read back into the game of Gin Rummy it records, by playing every move again through the rules; null for anything they cannot play out.
encodeGinfunctionA game of Gin Rummy as text: its table, its seed and its moves, never a hand.
GIN_BONUSconstantThe bonus for gin, and for an undercut.
GIN_RUMMY_RULESconstantGin Rummy as one CardGameRules: everything a table asks of the game.
GIN_SEATSconstantHow many play Gin Rummy: two.
ginComputerfunctionThe move a computer in the seat to play makes: always one the rules allow.
GinGametypeA GAME OF GIN RUMMY: its table and moves (what is kept), and the hand they have reached.
GinLayouttypeEach hand's player, laid out: their melds, and the cards left over.
GinMeldtypeA meld: three or four of a rank, or a run of three or more in one suit.
GinMovetypeA card drawn from the stock or taken from the discard pile, or a card thrown: laid on the pile, or face down to knock.
ginMovesfunctionEvery move the seat to play may make now; none once the game is over.
GinResulttypeHow a hand ended: who scored and how much, and how each hand was laid down.
ginSensiblefunctionA player a test can play at random who still ends a hand: a random draw and a random throw, but a knock whenever the card thrown allows one.
ginViewfunctionThe part of the game the seat to play can see, which is all its computer is given.
GinViewtypeA COMPUTER AT THE GIN RUMMY TABLE: it takes the discard only when the card goes straight into a meld, throws the card that leaves the least deadwood (the highest of those that tie, and never one the other player has shown they are collecting when another will do), and knocks the moment it can.
ginWinnersfunctionThe first to the game's total wins.
isMeldfunctionWhether these cards are a meld: three or four of a rank, or three or more in a row in one suit.
KNOCK_MOSTconstantThe most deadwood a player may knock with.
layOfffunctionThe defender's side of a knock: their own melds first, then every card left that fits one of the knocker's melds laid off onto it — a run grown one card at a time, so a six can follow the five just laid.
meldsInfunctionEvery meld that can be made from these cards: each set of three or four, and each run of three or more.
playGinfunctionThe game after that move, with the move added to its record, or null for a move the rules refuse.
sortGinfunctionA hand sorted as a player holds it: by suit (spades, hearts, clubs, diamonds, as the colours alternate), ace low.
startGinfunctionA new game of Gin Rummy for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Gin Rummy is not offered for.
UNDERCUT_BONUSconstantThe bonus for an undercut: the defender has no more deadwood than the knocker.
wantedfunctionWhether the discard would go straight into a meld: the hand with it and its best throw has less deadwood than now.
@johnmorrisdotca/toranpu/wardecodeWarfunctionText read back into the game of War it records, by playing every move again through the rules; null for anything they cannot play out.
encodeWarfunctionA game of War as text: its table, its seed and its moves, never a pile.
isWarMovefunctionWhether something is the one move War has.
playWarfunctionThe game after the cards are turned over: the whole turn, through however many wars it takes, or null for a move the rules refuse.
startWarfunctionA new game of War for these two players at this size (how many turns it may last), dealt from the seed, or null for a table War is not offered for.
WAR_FACE_DOWNconstantThe cards a player lays in a war before the one turned up.
WAR_RULESconstantWar as one CardGameRules: everything a table asks of the game.
warComputerfunctionThe move a computer makes: the only one War has.
WarEndtypeWhy a game of War ended: one player has every card ("cleared"), a player could not finish a war and the other could, or both could not and one ran out first ("short"), both ran out together ("drawn"), or the turns ran out ("limit").
WarGametypeA GAME OF WAR: its table and moves (what is kept), and what they make.
WarLaidtypeOne card laid in a turn: who laid it, and whether it lay face down (the three of a war) or was turned up.
WarMovetypeThe one thing a player does at War: turn the top cards over.
warMovesfunctionEvery move the table may make now: turning the cards over, until the game is over.
warRankfunctionHow a rank counts at War: the ace highest, then king down to two.
WarTurntypeWhat the table saw of the last turn: every card laid, in the order laid, how many wars the turn went through (0 for a plain turn of the cards), and who took the cards (null when the turn ended the game on a war that was not finished).
warWinnersfunctionThe seats that won a game that is over: the player with more cards, both when the piles are level or the game was a draw; nobody while it goes on.
@johnmorrisdotca/toranpu/stack-updecodeStackUpfunctionText read back into the game of Stack Up it records, by playing every move again through the rules; null for anything they cannot play out.
encodeStackUpfunctionA game of Stack Up as text: its table, its seed and its moves, never a hand.
isStackUpMovefunctionWhether something is a move Stack Up has, by its shape.
playStackUpfunctionThe game after a move, or null for a move the rules refuse.
STACK_UP_DECKconstantThe whole deck of 162 cards, in a fixed order: 1 to 12 twelve times over, then the wilds.
STACK_UP_HANDconstantHow many cards a hand is drawn up to.
STACK_UP_PILESconstantThe four building piles in the middle, and the four discard piles each player has.
STACK_UP_RULESconstantStack Up as one CardGameRules: everything a table asks of the game.
STACK_UP_STOCKSconstantThe sizes of a stock pile a table is offered.
STACK_UP_TOPconstantThe highest number on a card, and the length a building pile is finished at.
STACK_UP_WILDconstantThe wild card's name.
stackUpComputerfunctionThe move a computer makes: the best play it has, or else the card it would miss least, put where it does least harm.
StackUpEndtypeWhy a game is over: someone played their last stock card, or nothing could be played for a whole round with no cards left to draw, and the fewest stock cards left wins.
stackUpFitsfunctionWhether a card may go on a building pile: a wild always, a number when it is the one the pile wants.
StackUpGametypeA game of Stack Up: every seat's stock, hand and four discard piles, the four building piles, the cards still to draw and the finished piles waiting to be shuffled back in.
StackUpMovetypeOne move at Stack Up: a card laid on a building pile (from the hand, the top of the stock, or the top of one of your own discard piles), a card put on a discard pile, which ends the turn, or a pass when there is nothing in hand to discard.
stackUpMovesfunctionEvery move the seat to play may make: each card that fits a building pile, from the hand, the stock or a discard pile; each card of the hand on each discard pile; and a pass when the hand is empty.
stackUpValuefunctionWhat a card counts for: its number 1 to 12, or 0 for a wild, which is whatever a pile wants.
stackUpWantsfunctionWhat number a building pile wants next: one more than the cards on it.
stackUpWinnersfunctionThe seats that won a game that is over: the one who emptied their stock, or at a stuck table those with the fewest cards left; empty while it is being played.
startStackUpfunctionA new game of Stack Up for two to six players with a stock pile of this size, dealt from the seed, or null for a table it is not offered for.
@johnmorrisdotca/toranpu/klondikeallFaceUpfunctionWhether every card on the columns is face up: from here the game plays itself out (autoFinish).
bestFirstfunctionA winning line from this table — every move a replay of it makes, the settling ones included — or null when none was found within budget tables.
BestFirstGametypeA BEST-FIRST SEARCH for a card game played alone, shared by FreeCell's solver and Spider's (freecell/solve.ts, spider/solve.ts).
carriedFromfunctionWhich card of a column a carry to to would take: the one face-up card whose run fits there, or null.
COLUMN_PILESconstantThe columns, as a move names them.
columnAtfunctionWhich column, from 0, a pile a move names is.
COLUMNSconstantHow many columns the tableau has.
dealKlondikefunctionDeal a deck (card numbers, the first dealt first) into a table: column by column along each row, as a dealer does.
dealOffunctionA deal string from card numbers.
dealOfSeedfunctionThe deal of a seed: the site's one shuffle (shuffledDeck), written down.
deckOffunctionThe deck a deal string names, as card numbers, or null for one that is not a whole deck.
decodeMovesfunctionA move list read back, or null for one with a character that is no move.
DRAW_CODEconstantThe letter a draw from the stock is written as, in a move list.
encodeMovefunctionOne move written as text: one or two letters.
encodeMovesfunctionA list of moves written as text, one after another with nothing between.
finishingMovesfunctionTHE GAME PLAYS ITSELF OUT once every card on the columns is face up: the moves that bring the rest home, found by the solver on a small budget (a table with nothing hidden is solved in a handful of tables), or null while a card is still face down or no way home is found — then the player goes on.
fitsColumnfunctionWhether a card may go onto a column: onto a card one higher of the other colour, or a King onto an empty one.
fitsFoundationfunctionWhether a card may go onto its suit's foundation now.
FOUNDATION_PILESconstantThe foundations' letters, in SUITS order (spades, hearts, diamonds, clubs), as a card id writes a suit.
foundationAtfunctionWhich foundation, from 0 in SUITS order, a pile a move names is.
foundationPileOffunctionThe foundation a card goes to.
homeMovefunctionThe move that sends a top card home, if it can go: what a double tap does.
isColumnPilefunctionWhether a pile a move names is a column.
isFoundationPilefunctionWhether a pile a move names is a suit's foundation.
isSafeHomefunctionWhether a card is one the solver treats as home safely: exported for its test.
KlondikeColumntypeOne of the seven columns: its cards from the bottom up, of which the first down lie face down.
KlondikeMovetypeOne move: turn cards from the stock (draw), turn the waste back over (recycle), or carry cards from one pile to another.
KlondikePiletypeA place on the table a move names: the stock s, the waste w, a suit's foundation by its letter (S H D C, as a card id writes a suit), or a column 1–7.
KlondikeRulestypeHow the game was set up: cards turned from the stock at a time, and how many times through the stock (Infinity for no limit).
KlondikeTabletypeA game of Klondike as it stands: every pile, and the rules it is played under.
klondikeWonfunctionWhether every card is home.
liftablefunctionThe cards a person can take hold of from a spot, the one held and every one on it, or none: the waste's top card, a foundation's top card, or any face-up card of a column with the run on top of it.
moveForfunctionThe move that carries the cards held at from to to, if the rules allow exactly those cards there.
movesFromfunctionEvery move the rules allow from this table, in a fixed order: to the foundations first, then onto the columns, then the stock.
pileCardsfunctionThe cards of a pile, bottom first, as the table holds them.
playKlondikefunctionThe table after a move, or null where the rules refuse it.
rankOffunctionA card's rank, 1 for an ace to 13 for a king.
RANKS_A_SUITconstantHow many ranks a suit has, ace to king.
RECYCLE_CODEconstantThe letter turning the waste back over is written as, in a move list.
recyclesLeftfunctionHow many times the waste may still be turned back: passes less one, less those already made.
redCardfunctionHearts and diamonds, the second and third suits.
replayfunctionA game played out from its deal: every table it passed through, the first the deal, or null where the deal is not a deck or a move is one the rules refuse.
solveKlondikefunctionA winning line from this table — every move, the safe ones home included, that a replay of it makes — or null when none was found within budget tables.
stockMovefunctionWhat a press on the stock does: turn it, or turn the waste back over, or nothing once the passes are spent.
stuckfunctionWhether nothing can be done but give up: no card can move anywhere, and the stock can be neither turned nor turned back.
suitOffunctionA card's suit, 0 to 3 in SUITS order.
TableSpottypeA card on the table, as a person points at it: the pile, and its place from the bottom (-1 for the pile's empty place).
@johnmorrisdotca/toranpu/freecellbestFirstfunctionA winning line from this table — every move a replay of it makes, the settling ones included — or null when none was found within budget tables.
BestFirstGametypeA BEST-FIRST SEARCH for a card game played alone, shared by FreeCell's solver and Spider's (freecell/solve.ts, spider/solve.ts).
CELL_PILESconstantThe free cells, as a move names them: as many as the game is played with, from the first.
cellAtfunctionWhich free cell, from 0, a pile a move names is.
COLUMN_PILESconstantThe columns, as a move names them.
columnAtfunctionWhich column, from 0, a pile a move names is.
COLUMNSconstantHow many columns the tableau has.
countOntofunctionHow many cards a carry from one column to another takes, where it is not the player's to say: onto a card, the one count whose foot fits it.
dealFreeCellfunctionDeal a deck (card numbers, the first dealt first) into a table with so many free cells: one card to each column in turn.
dealOfSeedfunctionThe deal of a seed: the site's one shuffle (shuffledDeck), written down.
deckOffunctionThe deck a deal string names, as card numbers, or null for one that is not a whole deck.
decodeMovesfunctionA move list read back, or null for one with a character that is no move.
encodeMovefunctionOne move written as text: one or two letters.
encodeMovesfunctionA list of moves written as text, one after another with nothing between.
fitsFoundationfunctionWhether a card may go onto its suit's foundation now.
followsfunctionWhether upper may lie on lower in a column: one lower, of the other colour.
FOUNDATION_PILESconstantThe foundations' letters, in SUITS order (spades, hearts, diamonds, clubs), as a card id writes a suit.
foundationAtfunctionWhich foundation, from 0 in SUITS order, a pile a move names is.
foundationPileOffunctionThe foundation a card goes to.
FREECELL_PILESconstantEvery pile's letter, for a move written down to be read back.
freeCellFinishingMovesfunctionTHE GAME PLAYS ITSELF OUT once nothing is left to decide: when every card still out can go home in turn, the lowest first, the moves that take them there — or null while one cannot, and the player goes on.
freeCellHomeMovefunctionThe move that sends a top card home, if it can go: what a double tap does.
freeCellLiftablefunctionThe cards a person can take hold of from a spot, the one held and every one on it, or none: a free cell's card, or a column's card with the run in order on top of it.
FreeCellMovetypeOne move: count cards carried from one pile to another.
freeCellMoveForfunctionThe move that carries the cards held at from to to, if the rules allow exactly those cards there.
FreeCellPiletypeA place on the table a move names: a column 1–8, a free cell a–d, or a suit's foundation by its letter (S H D C, as a card id writes a suit).
freeCellPileCardsfunctionThe cards of a pile, bottom first, as the table holds them.
FreeCellSpottypeA card on the table, as a person points at it: the pile, and its place from the bottom (-1 for the pile's empty place).
freeCellStuckfunctionWhether nothing can be done but give up: no card can move anywhere.
FreeCellTabletypeA game of FreeCell as it stands: the columns, the free cells and the foundations.
freeCellWonfunctionWhether every card is home.
isCellPilefunctionWhether a pile a move names is a free cell.
isColumnPilefunctionWhether a pile a move names is a column.
isFoundationPilefunctionWhether a pile a move names is a suit's foundation.
mostCarriedfunctionThe most cards a carry may take, as though moved one at a time: one more than the empty free cells, doubled for every empty column but the one the cards are going to.
movesFromfunctionEvery move the rules allow from a table, one of each (the longest run into an empty column), for a stuck-game check.
playFreeCellfunctionThe table after a move, or null where the rules refuse it.
rankOffunctionA card's rank, 1 for an ace to 13 for a king.
RANKS_A_SUITconstantHow many ranks a suit has, ace to king.
redCardfunctionHearts and diamonds, the second and third suits.
replayFreeCellfunctionA game played out from its deal: every table it passed through, the first the deal, or null where the deal is not a deck or a move is one the rules refuse.
runLengthfunctionHow many cards on top of a column are in order, each on the one under it: the most a single carry could ever take.
solveFreeCellfunctionA winning line from this table — every move a replay of it makes, the safe ones home included — or null when none was found within budget tables.
suitOffunctionA card's suit, 0 to 3 in SUITS order.
topOffunctionThe top card of a pile, or undefined where it holds none (a foundation's top is its suit at its count).
@johnmorrisdotca/toranpu/spiderallShowingfunctionWhether every card is dealt and face up: from here the game plays itself out, where it can (finishingMoves).
bestFirstfunctionA winning line from this table — every move a replay of it makes, the settling ones included — or null when none was found within budget tables.
BestFirstGametypeA BEST-FIRST SEARCH for a card game played alone, shared by FreeCell's solver and Spider's (freecell/solve.ts, spider/solve.ts).
canDealfunctionWhether the stock can deal now: cards left, and no column empty.
COLUMNSconstantHow many columns the tableau has.
countOntofunctionHow many cards a carry from one column onto another takes, where it is not the player's to say: onto a card, the one count whose foot is one lower.
DEAL_CODEconstantThe letter dealing a card to every column is written as, in a move list.
dealSpiderfunctionDeal a shuffled deck (card numbers, the first dealt first) into a table.
DEALTconstantCards dealt to the columns before play; the rest are the stock.
DECK_SIZEconstantHow many cards two decks hold, which Spider is played with at any number of suits.
decodeMovesfunctionA move list read back, or null for one with a character that is no move.
encodeMovefunctionOne move written as text: one or two letters.
encodeMovesfunctionA list of moves written as text, one after another with nothing between.
movesFromfunctionEvery move the rules allow from a table, one of each (the whole run into an empty column), for a stuck-game check.
playSpiderfunctionThe table after a move, or null where the rules refuse it.
rankOffunctionA card's rank, 1 for an ace to 13 for a king.
RANKS_A_SUITconstantHow many ranks a suit has, ace to king.
replaySpiderfunctionA game played out from its deal: every table it passed through, the first the deal, or null where the deal is not two decks or a move is one the rules refuse.
runLengthfunctionHow many cards on top of a column are one suit and in order, all face up: the most a carry can take.
RUNS_TO_WINconstantFull runs to make: two decks of four suits.
solveSpiderfunctionA winning line from this table, or null when none was found within budget tables.
spiderBestMovefunctionWhat a double tap does in Spider, where no card goes home by itself: the run carried to the best column that takes it — one whose top is its own suit, else any card one higher, else an empty column.
SpiderColumntypeOne of the ten columns: its cards from the bottom up, of which the first down lie face down.
spiderColumnOffunctionThe column a pile names, or null for the stock and the made runs.
spiderDealMovefunctionWhat a press on the stock does: deal, or nothing while a column is empty or the stock is spent.
spiderDealOfSeedfunctionThe deal of a seed at so many suits: the site's one shuffle (shuffled) of both decks, written down.
spiderDeckfunctionThe hundred and four cards of a game of so many suits, sorted: each suit's thirteen, as many times as fill two decks.
spiderDeckOffunctionThe cards a deal string names, or null for one that is not both decks of a game of so many suits.
spiderFinishingMovesfunctionTHE GAME PLAYS ITSELF OUT once every card is dealt and face up: the moves that make the runs left, found by the solver on a small budget, or null while a card is hidden or no way is found — then the player goes on.
spiderLiftablefunctionThe cards a person can take hold of from a spot: a face-up card with the run of its own suit, in order, on top of it.
SpiderMovetypeOne move: deal a card from the stock onto every column (deal), or carry count cards from the top of one column onto another.
spiderMoveForfunctionThe move that carries the cards held at from onto the column to, if the rules allow exactly those cards there.
SpiderSpottypeA place a tap lands on the table: the pile, and which card in it from the bottom.
spiderStuckfunctionWhether nothing can be done but give up: no card can move and the stock cannot deal.
SpiderTabletypeA game of Spider as it stands: the columns, the cards still to deal, and the runs sent home.
spiderWonfunctionWhether all eight runs are made.
suitOffunctionA card's suit, 0 to 3 in SUITS order.
suitsForfunctionThe suits a game of so many suits is played with, in SUITS order: spades; spades and hearts; all four.
@johnmorrisdotca/toranpuallDifferentfunctionWhether a list names no card twice.
BIG_TWO_DEALSconstantHow many deals a game of Big Two may last.
bigTwonamespaceCARD_GAME_KINDSconstantThe twelve kinds by name, for code that would rather not type a string twice.
CARD_GAME_LISTconstantEvery card game.
CARD_GAME_RULESconstantEVERY CARD GAME'S RULES, by kind: what a table plays and what the simulation plays out.
CARD_GAME_TABLESconstantEvery game's table: the fewest, the most and the usual number of players, the lengths of game offered and the usual one.
cardGameCodecfunctionThe keeping for one game: game names it, so one game's text is never read as another's; start and play are its rules; isMove checks a move's shape before the rules are asked about it.
CardGameCodectypeA game's keeping: encode writes it as text, decode reads it back or gives null.
CardGameKindtypeTHE CARD GAMES, and the tables each offers.
CardGamePlaystypeEach card game's game and move, so its rules can be named with their own types.
CardGameRulestypeWHAT EVERY CARD GAME'S RULES ANSWER, whatever the game.
CardGameTabletypeWhat a game's table offers: how many may sit at it, and how long a game may last.
CardIdtypeA card by its short name: rank letter then suit letter, "QS", "TD", "AH" (cards.ts).
cardOffunctionThe card of this rank and suit.
cardOfIdfunctionThe deck's card for an id, for the deck's components to draw.
CardRanktypeThe deck's rank, ace low: 1 is the ace, 11 the jack, 12 the queen, 13 the king.
CardSeatstypeWho sits in each seat: the name the set-up gave, and whether a computer plays it.
cardShortfunctionA card as a corner shows it: "Q♠", "10♦".
cardsShortfunctionCards as corners show them, with a space between: "Q♠ 10♦ A♥".
CardSuittypeClubs, diamonds, hearts, spades.
cardTextfunctionA card's name in full: "queen of spades", or "スペードのクイーン" in Japanese.
cardWordsfunction"queen of spades", as a sentence and a screen reader say it.
choicesfunctionEvery way of choosing count of these cards, in the order they are given.
cliLanguagefunctionThe language the command line speaks: --lang, or the environment's, or the system's; Japanese for ja…, English for anything else.
CliResulttypeWhat the command line came to.
CliSurroundingstypeWhat the command line is run in.
computerSeatsfunctionThe seats a computer plays, one a seat, from what the set-up said: a seat it said nothing about is a person's.
CRAZY_EIGHTS_SIZESconstantThe scores a game of Crazy Eights may be played to.
crazyEightsnamespacecribbagenamespaceCRIBBAGE_SIZESconstantThe scores a game of Cribbage may be played to: once round the board, or twice.
CSV_COLUMNSconstantThe columns of the CSV, in order.
dealRoundfunctionDeals the cards one at a time round the table, from the first seat, as a dealer does: each to a seat, or every card when each is absent (so some seats hold one more than others).
euchrenamespaceEUCHRE_SIZESconstantThe scores a game of Euchre may be played to.
fillInfunctionPut values into a string's braces: fillIn("Bid {n}", { n: 3 }) is "Bid 3".
fromCodefunctionA game from its code or its JSON: the same as fromJSON, under the name that pairs with toCode.
fromJSONfunctionA game from text that toJSON or toCode wrote, whichever game it is.
FULL_DECKconstantEvery card, in the deck's own order.
gameNamefunctionA game's name: "Hearts", or "ハーツ" in Japanese.
GameOftypeA game of that kind, in progress.
gameSaysfunctionA game in a line: what it is about, for a list of games.
GIN_SIZESconstantThe scores a game of Gin Rummy may be played to.
ginRummynamespaceGO_FISH_SIZESconstantGo Fish is one deal: its only size is 1.
goFishnamespaceheartsnamespaceHEARTS_SIZESconstantHow long each game lasts, in its own terms (see above).
isCardfunctionWhether this is one of the fifty-two names.
isCardListfunctionA list of card names, checked for shape only: whether they are cards the game holds is the rules' to say.
KeptCardGametypeWhat every card game's state carries for its keeping.
LanguagetypeThe languages Toranpu speaks.
languageOffunctionThe language a tag such as ja-JP or en_US.UTF-8 names: Japanese for anything that starts ja, English otherwise.
mixSeedfunctionTwo numbers folded into one seed, so each deal of a game (and each reshuffle within one) has its own order.
MoveOftypeA move in a game of that kind.
moveTextfunctionA move in words, for any of the twelve games: moveText("hearts", { play: "QS" }) is "Play Q♠", and with { form: "did" } it is "plays Q♠".
MoveTextOptionstypeHow a move is put into words.
namesListfunctionNames in a list: "Ann, Ben", or "Ann、Ben" in Japanese.
newGamefunctionA new game of that kind, or null when the game is not offered for that table (too many players, or a size it does not play to).
NewGameOptionstypeHow to seat a new game.
nextSeatfunctionThe next seat round the table, to the left: the order every game here plays in.
OH_HELL_DEALSconstantHow many deals a game of Oh Hell may last: up to seven cards, or up and back down.
ohHellnamespaceplayComputersfunctionEvery computer move due, played in turn until a person is to move or the game is over.
presidentnamespacePRESIDENT_ROUNDSconstantHow many rounds a game of President may last.
RandomtypeA number in [0, 1), like Math.random, from a stream a seed fixes.
randomSeedfunctionA seed for a game nobody asked for by number: a whole number from 1 to 2³¹ − 1.
RANK_LETTERSconstantThe rank letters, ace low: an index here plus one is the rank (A = 1, J = 11, Q = 12, K = 13).
rankNamefunctionA rank as a sentence names one card of it: "queen", "seven"; in Japanese "クイーン", "7".
rankOffunctionA card's rank, ace low: 1 to 13.
rankWordsfunctionA rank named in the plural, as it is asked for: "sevens", "sixes", "queens".
ReadGametypeA game read back: which game it is, and the game itself.
RecordedMovetypeOne move of a record: which seat made it, and the move.
recordOffunctionEvery move of a game with the seat that made it, in order, found by playing the game through again from its seed.
reshuffledfunctionThese cards shuffled again, the same way for the same seed and salt: a pile turned over to make a new stock.
rulesForfunctionA game's rules by its kind, with its own game and move types.
runClifunctionRun the command line.
SAVE_FORMATconstantThe shape of the JSON this package writes.
savedGamefunctionA game as the object toJSON writes: its table, its seed and its moves.
SavedGametypeA game as toJSON writes it.
seededRandomfunctionA stream of numbers in [0, 1) fixed by a seed.
shuffledfunctionA copy of the list in a random order (Fisher–Yates); the list given is left alone.
shuffledDeckfunctionThe deck shuffled for one deal of one game: the same seed and deal always the same order, so a game kept as its seed and moves deals itself again exactly, and reloading can never re-deal a hand somebody has seen.
spadesnamespaceSPADES_SIZESconstantThe scores a game of Spades may be played to.
STACK_UP_SIZESconstantThe cards in each player's stock pile at a game of Stack Up: the longer, the longer the game.
stackUpnamespaceSTRINGSconstantEvery string, in both languages.
suitNamefunctionA suit's name: "spades", or "スペード" in Japanese.
suitOffunctionA card's suit, as its letter: S, H, D or C.
suitSymbolfunctionA suit's symbol: ♠ ♥ ♦ ♣.
suitWordsfunctionA suit's name: "spades".
toCodefunctionA game as its code: the one line its own rules' encode writes.
toCSVfunctionA game's moves as CSV for a spreadsheet: a header, then a row a move, with its number from 1, the seat from 1 and its player, the kind of move (play, bid, pass…), the cards it names as two-letter ids with spaces between, the move itself as JSON, and the move in English.
toJSONfunctionA game as JSON, two spaces deep, with the format's number first.
ToranpuStringstypeThe names of the strings.
toTextfunctionA game as a record a person can read: a heading, a numbered line a move with who made it, and how it stands.
VERSIONconstantThe version of this package, as package.json has it.
warnamespaceWAR_ROUNDSconstantHow many turns of the cards a game of War may last before the player holding more cards wins.
withoutfunctionThe hand without these cards, or null when it does not hold every one of them.