本文へ移動

Toranpuトランプ

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

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

目次

リファレンス

スパイダー

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

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

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

Spider: its table at one, two or four suits, its rules, its moves written as text, a solver, and what a tap on the table means.

エクスポート

名前種類概要
allShowing関数Whether every card is dealt and face up: from here the game plays itself out, where it can (finishingMoves).
bestFirst関数A winning line from this table — every move a replay of it makes, the settling ones included — or null when none was found within budget tables.
BestFirstGame型A BEST-FIRST SEARCH for a card game played alone, shared by FreeCell's solver and Spider's (freecell/solve.ts, spider/solve.ts).
canDeal関数Whether the stock can deal now: cards left, and no column empty.
COLUMNS定数How many columns the tableau has.
countOnto関数How many cards a carry from one column onto another takes, where it is not the player's to say: onto a card, the one count whose foot is one lower.
DEAL_CODE定数The letter dealing a card to every column is written as, in a move list.
dealSpider関数Deal a shuffled deck (card numbers, the first dealt first) into a table.
DEALT定数Cards dealt to the columns before play; the rest are the stock.
DECK_SIZE定数How many cards two decks hold, which Spider is played with at any number of suits.
decodeMoves関数A move list read back, or null for one with a character that is no move.
encodeMove関数One move written as text: one or two letters.
encodeMoves関数A list of moves written as text, one after another with nothing between.
movesFrom関数Every move the rules allow from a table, one of each (the whole run into an empty column), for a stuck-game check.
playSpider関数The table after a move, or null where the rules refuse it.
rankOf関数A card's rank, 1 for an ace to 13 for a king.
RANKS_A_SUIT定数How many ranks a suit has, ace to king.
replaySpider関数A game played out from its deal: every table it passed through, the first the deal, or null where the deal is not two decks or a move is one the rules refuse.
runLength関数How many cards on top of a column are one suit and in order, all face up: the most a carry can take.
RUNS_TO_WIN定数Full runs to make: two decks of four suits.
solveSpider関数A winning line from this table, or null when none was found within budget tables.
spiderBestMove関数What a double tap does in Spider, where no card goes home by itself: the run carried to the best column that takes it — one whose top is its own suit, else any card one higher, else an empty column.
SpiderColumn型One of the ten columns: its cards from the bottom up, of which the first down lie face down.
spiderColumnOf関数The column a pile names, or null for the stock and the made runs.
spiderDealMove関数What a press on the stock does: deal, or nothing while a column is empty or the stock is spent.
spiderDealOfSeed関数The deal of a seed at so many suits: the site's one shuffle (shuffled) of both decks, written down.
spiderDeck関数The hundred and four cards of a game of so many suits, sorted: each suit's thirteen, as many times as fill two decks.
spiderDeckOf関数The cards a deal string names, or null for one that is not both decks of a game of so many suits.
spiderFinishingMoves関数THE GAME PLAYS ITSELF OUT once every card is dealt and face up: the moves that make the runs left, found by the solver on a small budget, or null while a card is hidden or no way is found — then the player goes on.
spiderLiftable関数The cards a person can take hold of from a spot: a face-up card with the run of its own suit, in order, on top of it.
SpiderMove型One move: deal a card from the stock onto every column (deal), or carry count cards from the top of one column onto another.
spiderMoveFor関数The move that carries the cards held at from onto the column to, if the rules allow exactly those cards there.
SpiderSpot型A place a tap lands on the table: the pile, and which card in it from the bottom.
spiderStuck関数Whether nothing can be done but give up: no card can move and the stock cannot deal.
SpiderTable型A game of Spider as it stands: the columns, the cards still to deal, and the runs sent home.
spiderWon関数Whether all eight runs are made.
suitOf関数A card's suit, 0 to 3 in SUITS order.
suitsFor関数The suits a game of so many suits is played with, in SUITS order: spades; spades and hearts; all four.

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

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