本文へ移動

Toranpuトランプ

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

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

目次

リファレンス

大富豪

import { … } from "@johnmorrisdotca/toranpu/president";

最小化と gzip 圧縮をしたサイズは 3.5 kB(読み込むものをすべて含み、esbuild で計測)

リファレンスの説明と例は英語です。見出しと目次は日本語です。

President: its rules, its computer player and its saved-game format.

エクスポート

名前種類概要
afterTurn関数Whose move it is after from played or passed: the next seat still in that has not passed, or — when nobody is left to answer — the trick cleared and led by whoever played last, or the next seat after them still in.
ClimbMove型Cards played to beat the table (or lead), or a pass.
ClimbPlay型What is on the table: the last cards played to this trick, and whose they were.
ClimbTrick型The part of a climbing game's state the trick machinery moves: every climbing game carries these.
decodePresident関数Text read back into the game of President it records, by playing every move again through the rules; null for anything they cannot play out.
encodePresident関数A game of President as text: its table, its seed and its moves, never a hand.
freshTrick関数A fresh trick to lead, for a new deal.
isClimbMove関数A move read back from storage, checked for shape: cards to play, or a pass.
laid関数The trick after seat lays these cards on it: out of their hand, on the table, and seen by all.
nextRound関数The next seat round from from (not counting it) that wanted accepts, or null when none does.
passedOn関数The trick after seat passes.
playPresident関数The game after that move, with the move added to its record, or null for a move the rules refuse.
PRESIDENT_RULES定数President as one CardGameRules: everything a table asks of the game.
presidentComputer関数The move a computer in the seat to play makes: always one the rules allow.
PresidentGame型A GAME OF PRESIDENT: its table and moves (what is kept), and the round they have reached.
presidentMayPlay関数Whether these cards may be played now by the seat to play: one rank, one to four of it, higher than the table's and as many.
PresidentMove型A climbing move, or the cards a President or Vice-President hands back down at the start of a round.
presidentMoves関数Every move the seat to play may make now; none once the game is over.
presidentRank関数A rank's height: the three lowest (0), the two highest (12).
PresidentSwap型Cards handed over at the start of a round: the best cards up, whatever the receiver chooses back down.
presidentSwapCount関数How many cards the President and the Beggar swap: two, or one when only three are at the table.
presidentTitle関数A seat's title from a round's finishing order.
PresidentTitle型Each seat's title from a round's finishing order: 0 President, 1 Vice-President, the last two Vice-Beggar and Beggar, everybody else a Citizen.
presidentView関数The part of the game the seat to play can see, which is all its computer is given.
PresidentView型What one seat can see of a game of President: its own hand, the table, and what has been said and shown.
presidentWinners関数The most points wins; level on the most shares it.
seatsIn関数The seats still holding cards.
sortPresident関数Cards in President's order, lowest first, suits in a fixed order only so a hand always sorts the same way.
startPresident関数A new game of President for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table President is not offered for.

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

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