本文へ移動

Toranpuトランプ

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

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

目次

リファレンス

ユーカー

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

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

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

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

エクスポート

名前種類概要
dealerOf関数The seat that deals this hand: the first seat, then round to the left.
decodeEuchre関数Text read back into the game of Euchre it records, by playing every move again through the rules; null for anything they cannot play out.
encodeEuchre関数A game of Euchre as text: its table, its seed and its moves, never a hand.
EUCHRE_DECK定数The cards Euchre is played with: nine to ace of each suit.
EUCHRE_RULES定数Euchre as one CardGameRules: everything a table asks of the game.
EUCHRE_SEATS定数How many play Euchre: four, in two partnerships.
euchreComputer関数The move a computer in the seat to play makes: always one the rules allow.
EuchreGame型A GAME OF EUCHRE: its table and moves (what is kept, KeptCardGame), and everything the moves make.
EuchreHandScore型What one hand did: which partnership made trumps, the tricks it took, and the points each partnership scored.
euchreHeight関数A card's height within its suit as the hand is played: ace high; in trumps the right bower, then the left, above everything.
EuchreMove型Ordering up the card turned up, or passing; naming another suit, or passing; the dealer throwing a card after picking the turned one up; or a card played to the trick.
euchreMoves関数Every move the seat to play may make now; none once the game is over.
EuchrePhase型The first round of the making (take the turned card's suit, or pass), the second (name another suit, or pass — the dealer may not), the dealer's discard, the tricks, or the game over.
EuchrePlay型One card laid, and whose it was.
euchrePlayable関数The cards the seat to play may lay on the trick: the suit led (the left bower counting as a trump) if it holds any.
euchreTrickWinner関数Who is taking a trick: the highest trump, or else the highest card of the suit led.
euchreView関数The part of the game the seat to play can see, which is all its computer is given.
EuchreView型A COMPUTER AT THE EUCHRE TABLE.
euchreWinners関数The partnership with the higher score wins, both its seats.
handPoints関数What a hand scores: one to the makers for three or four tricks, two for all five, and two to the other side when the makers take two or fewer.
partnerOf関数The seat across the table.
playEuchre関数The game after that move, with the move added to its record, or null for a move the rules refuse.
sameColour関数The suit of the same colour: clubs and spades, diamonds and hearts.
sortEuchre関数A hand sorted as a player holds it: by suit (trumps last once made), high cards to the right.
startEuchre関数A new game of Euchre for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Euchre is not offered for.
suitIn関数The suit a card belongs to once trumps are made: the left bower is a trump.
teamOf関数A seat's partnership: 0 for seats 0 and 2, 1 for seats 1 and 3.
throwAway関数After picking the turned card up: the lowest card outside trumps, from the shortest suit, never an ace.
trumpWorth関数How much a hand is worth with this suit as trumps, roughly in tricks.

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

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