本文へ移動

Toranpuトランプ

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

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

目次

リファレンス

クレイジーエイツ

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.

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

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