リファレンス
ハーツ
import { … } from "@johnmorrisdotca/toranpu/hearts";
最小化と gzip 圧縮をしたサイズは 3.6 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Hearts: its rules, its computer player and its saved-game format.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
choosePass | 関数 | The 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. |
decodeHearts | 関数 | Text read back into the game of Hearts it records, by playing every move again through the rules; null for anything they cannot play out. |
encodeHearts | 関数 | A game of Hearts as text: its table, its seed and its moves, never a hand. |
HEARTS_ALL_POINTS | 定数 | Every point in a deal: thirteen hearts and the queen. |
HEARTS_RULES | 定数 | Hearts as one CardGameRules: everything a table asks of the game. |
heartsComputer | 関数 | The move a computer in the seat to play makes: always one the rules allow. |
HeartsGame | 型 | A GAME OF HEARTS: its table and moves (what is kept, KeptCardGame), and everything the moves make, read again from them whenever the game is. |
heartsHeight | 関数 | A card's height in a trick: ace high. |
HeartsMove | 型 | Three cards passed (all three at once, as a player hands them over), or one card played to the trick. |
heartsMoves | 関数 | Every move the seat to play may make now; none once the game is over. |
HeartsPhase | 型 | Passing three cards before the deal is played, playing it out trick by trick, or the game over. |
HeartsPlay | 型 | One card laid on a trick, and whose it was. |
heartsPlayable | 関数 | The cards the seat to play may lay on the trick now. |
heartsPoints | 関数 | A card's points: a heart one, the queen of spades thirteen. |
heartsView | 関数 | The part of the game the seat to play can see, which is all its computer is given. |
HeartsView | 型 | What the seat to move can see: its own hand and the table. |
heartsWinners | 関数 | The lowest score wins; level on the lowest shares it. |
passOffset | 関数 | How far round the table the cards go this deal: 1 to the left, seats − 1 to the right, 2 across, 0 held. |
playHearts | 関数 | The game after that move, with the move added to its record, or null for a move the rules refuse. |
QUEEN_OF_SPADES | 定数 | The queen of spades, worth thirteen points to whoever takes her. |
sortHearts | 関数 | A hand sorted as a player holds it: clubs, diamonds, spades, hearts, low to high within each. |
startHearts | 関数 | A 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. |
trickWinner | 関数 | Who takes a finished trick: the highest card of the suit led. |
TWO_OF_CLUBS | 定数 | The two of clubs, which leads the first trick of every deal. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。