本文へ移動

Toranpuトランプ

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

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

目次

リファレンス

ゴーフィッシュ

import { … } from "@johnmorrisdotca/toranpu/go-fish";

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

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

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

エクスポート

名前種類概要
decodeGoFish関数Text read back into the game of Go Fish it records, by playing every move again through the rules; null for anything they cannot play out.
encodeGoFish関数A game of Go Fish as text: its table, its seed and its moves, never a hand.
GO_FISH_RULES定数Go Fish as one CardGameRules: everything a table asks of the game.
goFishComputer関数The move a computer in the seat to play makes: always one the rules allow.
GoFishEvent型What the whole table saw of a turn: who asked whom for what, how many cards were handed over, and — when none were — whether the card drawn from the pond was the rank asked for (which is shown, and earns another ask).
GoFishGame型A GAME OF GO FISH: its table and moves (what is kept), and what they make.
goFishHandSize関数Seven cards each for two or three players, five for more.
goFishMemory関数What the table's log says about every seat's hand, worked out from the asks, the answers and the books.
GoFishMemory型What the table has said about each seat's hand: for each seat, the ranks it is known to hold and known to be without.
GoFishMove型Asking one player for every card they hold of one rank.
goFishMoves関数Every move the seat to play may make now; none once the game is over.
goFishRanks関数The ranks the seat to move may ask for: those it holds.
goFishTargets関数The players the seat to move may ask: everybody else holding cards, or, when nobody else does, anybody else.
goFishView関数The part of the game the seat to play can see, which is all its computer is given.
GoFishView型What one seat can see of a game of Go Fish: its own hand, the table, and what has been said and shown.
goFishWinners関数The most books wins; level on the most shares it.
playGoFish関数The game after that move, with the move added to its record, or null for a move the rules refuse.
sortGoFish関数A hand as a player holds it: grouped by rank, ace to king.
startGoFish関数A new game of Go Fish for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Go Fish is not offered for.

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

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