リファレンス
クリベッジ
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。