本文へ移動

Toranpuトランプ

デッキを使い、11種類のゲームでコンピューターと対戦し、ソリティアを解いたり、独自の絵柄でカードを表示したりできます。

「トランプ」は、日本語で playing cards を指す言葉です。 名前について(英語)

目次

リファレンス

クリベッジ

import { … } from "@johnmorrisdotca/toranpu/cribbage";

最小化と gzip 圧縮をしたサイズは 3.7 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Cribbage: its rules, its computer player and its saved-game format.

エクスポート

名前種類概要
cardValue関数A card's worth in the count: ace one, court cards ten.
chooseCrib関数The two cards to lay away: the four kept worth most on average with every starter, the crib counted for or against.
choosePeg関数The card to peg: most points now, then a count kept off five and twenty-one, a low lead that is not a five.
CRIBBAGE_RULES定数Cribbage as one CardGameRules: everything a table asks of the game.
CRIBBAGE_SEATS定数How many play Cribbage here: two.
cribbageComputer関数The move a computer in the seat to play makes: always one the rules allow.
CribbageCount型What a hand's show is worth, by kind.
CribbageGame型A GAME OF CRIBBAGE: its table and moves (what is kept, KeptCardGame), and everything the moves make, read again from them whenever the game is.
CribbageHandScore型One hand as it was shown: the dealer, the starter, both four-card hands and the crib, and what each counted.
CribbageMove型Two cards laid away to the crib, or one card played in the pegging.
cribbageMoves関数Every move the seat to play may make now; none once the game is over.
CribbagePeg型What one card played in the pegging scored, and why: "fifteen", "a pair", "a run of three", "go", "last card", "thirty-one".
CribbagePhase型Both players laying two cards to the crib, the pegging, or the game over.
CribbagePlay型One card laid, and whose it was.
cribbagePlayable関数The cards a seat may play on the count now: any that keeps it to thirty-one.
cribbageView関数The part of the game the seat to play can see, which is all its computer is given.
CribbageView型A COMPUTER AT THE CRIBBAGE TABLE.
cribbageWinners関数The first to the total.
cribPairs関数Every way to lay two of a hand away.
dealerOf関数The seat that deals this hand: the first seat, then the other, turn about.
decodeCribbage関数Text read back into the game of Cribbage it records, by playing every move again through the rules; null for anything they cannot play out.
encodeCribbage関数A game of Cribbage as text: its table, its seed and its moves, never a hand.
otherOf関数The seat that is not this one.
pegPoints関数What laying the last card of cards scores, the count now count: fifteen, thirty-one, pairs and runs.
playCribbage関数The game after that move, with the move added to its record, or null for a move the rules refuse.
showCount関数What four cards and the starter are worth in the show.
sortCribbage関数A hand sorted as a player holds it: ace low to king, by rank then suit.
startCribbage関数A 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.
throwWorth関数What two cards thrown to a crib are worth to it, roughly: a pair, a fifteen, fives, and cards close enough to run.

ソースを見るGitHub で編集@johnmorrisdotca/toranpu 2.15.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。