本文へ移動

Toranpuトランプ

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

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

目次

リファレンス

積み上げ

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.

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

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