リファレンス
積み上げ
import { … } from "@johnmorrisdotca/toranpu/stack-up";
最小化と gzip 圧縮をしたサイズは 3.1 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Stack Up: its rules, its computer player and its saved-game format.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
decodeStackUp | 関数 | Text 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. |
encodeStackUp | 関数 | A game of Stack Up as text: its table, its seed and its moves, never a hand. |
isStackUpMove | 関数 | Whether something is a move Stack Up has, by its shape. |
playStackUp | 関数 | The game after a move, or null for a move the rules refuse. |
STACK_UP_DECK | 定数 | The whole deck of 162 cards, in a fixed order: 1 to 12 twelve times over, then the wilds. |
STACK_UP_HAND | 定数 | How many cards a hand is drawn up to. |
STACK_UP_PILES | 定数 | The four building piles in the middle, and the four discard piles each player has. |
STACK_UP_RULES | 定数 | Stack Up as one CardGameRules: everything a table asks of the game. |
STACK_UP_STOCKS | 定数 | The sizes of a stock pile a table is offered. |
STACK_UP_TOP | 定数 | The highest number on a card, and the length a building pile is finished at. |
STACK_UP_WILD | 定数 | The wild card's name. |
stackUpComputer | 関数 | The move a computer makes: the best play it has, or else the card it would miss least, put where it does least harm. |
StackUpEnd | 型 | Why 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. |
stackUpFits | 関数 | Whether a card may go on a building pile: a wild always, a number when it is the one the pile wants. |
StackUpGame | 型 | A 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. |
StackUpMove | 型 | One 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. |
stackUpMoves | 関数 | Every 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. |
stackUpValue | 関数 | What a card counts for: its number 1 to 12, or 0 for a wild, which is whatever a pile wants. |
stackUpWants | 関数 | What number a building pile wants next: one more than the cards on it. |
stackUpWinners | 関数 | The 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. |
startStackUp | 関数 | A 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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。