リファレンス
クレイジーエイツ
import { … } from "@johnmorrisdotca/toranpu/crazy-eights";
最小化と gzip 圧縮をしたサイズは 3.1 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Crazy Eights: its rules, its computer player and its saved-game format.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
CRAZY_EIGHTS_RULES | 定数 | Crazy Eights as one CardGameRules: everything a table asks of the game. |
crazyEightsComputer | 関数 | The move a computer in the seat to play makes: always one the rules allow. |
CrazyEightsGame | 型 | A GAME OF CRAZY EIGHTS: its table and moves (what is kept), and the hand they have reached. |
CrazyEightsMove | 型 | A card played (an eight names the suit to follow), a card drawn from the stock, or a turn passed. |
crazyEightsMoves | 関数 | Every move the seat to play may make now; none once the game is over. |
CrazyEightsResult | 型 | How a hand ended: who won it, and the points each winner took. |
crazyEightsView | 関数 | The part of the game the seat to play can see, which is all its computer is given. |
CrazyEightsView | 型 | What one seat can see of a game of Crazy Eights: its own hand, the table, and what has been said and shown. |
crazyEightsWinners | 関数 | The highest score wins, once somebody reaches the game's size; level on it shares the win. |
crazyHandSize | 関数 | Seven cards each for two players, five for more. |
crazyMatches | 関数 | Whether this card may go on the pile now: an eight always; otherwise the suit to follow or the top card's rank. |
crazyPlayable | 関数 | The cards the player to move may play now: after drawing, only the card drawn. |
crazyPoints | 関数 | What a card left in hand is worth to the winner of the hand. |
crazyTop | 関数 | The card on top of the discard pile. |
decodeCrazyEights | 関数 | Text 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. |
EIGHT | 定数 | The rank that is wild in Crazy Eights. |
encodeCrazyEights | 関数 | A game of Crazy Eights as text: its table, its seed and its moves, never a hand. |
longestSuit | 関数 | The suit this hand holds most of, eights aside; clubs first among equals so the choice is always the same. |
playCrazyEights | 関数 | The game after that move, with the move added to its record, or null for a move the rules refuse. |
sortCrazy | 関数 | A hand as a player holds it: eights last, the rest by suit and rank. |
startCrazyEights | 関数 | A 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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。