本文へ移動

Toranpuトランプ

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

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

目次

リファレンス

フリーセル

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

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

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

FreeCell: its table, its rules, its moves written as text, a solver, and what a tap on the table means.

エクスポート

名前種類概要
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).
CELL_PILES定数The free cells, as a move names them: as many as the game is played with, from the first.
cellAt関数Which free cell, from 0, a pile a move names is.
COLUMN_PILES定数The columns, as a move names them.
columnAt関数Which column, from 0, a pile a move names is.
COLUMNS定数How many columns the tableau has.
countOnto関数How many cards a carry from one column to another takes, where it is not the player's to say: onto a card, the one count whose foot fits it.
dealFreeCell関数Deal a deck (card numbers, the first dealt first) into a table with so many free cells: one card to each column in turn.
dealOfSeed関数The deal of a seed: the site's one shuffle (shuffledDeck), written down.
deckOf関数The deck a deal string names, as card numbers, or null for one that is not a whole deck.
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.
fitsFoundation関数Whether a card may go onto its suit's foundation now.
follows関数Whether upper may lie on lower in a column: one lower, of the other colour.
FOUNDATION_PILES定数The foundations' letters, in SUITS order (spades, hearts, diamonds, clubs), as a card id writes a suit.
foundationAt関数Which foundation, from 0 in SUITS order, a pile a move names is.
foundationPileOf関数The foundation a card goes to.
FREECELL_PILES定数Every pile's letter, for a move written down to be read back.
freeCellFinishingMoves関数THE GAME PLAYS ITSELF OUT once nothing is left to decide: when every card still out can go home in turn, the lowest first, the moves that take them there — or null while one cannot, and the player goes on.
freeCellHomeMove関数The move that sends a top card home, if it can go: what a double tap does.
freeCellLiftable関数The cards a person can take hold of from a spot, the one held and every one on it, or none: a free cell's card, or a column's card with the run in order on top of it.
FreeCellMove型One move: count cards carried from one pile to another.
freeCellMoveFor関数The move that carries the cards held at from to to, if the rules allow exactly those cards there.
FreeCellPile型A place on the table a move names: a column 1–8, a free cell a–d, or a suit's foundation by its letter (S H D C, as a card id writes a suit).
freeCellPileCards関数The cards of a pile, bottom first, as the table holds them.
FreeCellSpot型A card on the table, as a person points at it: the pile, and its place from the bottom (-1 for the pile's empty place).
freeCellStuck関数Whether nothing can be done but give up: no card can move anywhere.
FreeCellTable型A game of FreeCell as it stands: the columns, the free cells and the foundations.
freeCellWon関数Whether every card is home.
isCellPile関数Whether a pile a move names is a free cell.
isColumnPile関数Whether a pile a move names is a column.
isFoundationPile関数Whether a pile a move names is a suit's foundation.
mostCarried関数The most cards a carry may take, as though moved one at a time: one more than the empty free cells, doubled for every empty column but the one the cards are going to.
movesFrom関数Every move the rules allow from a table, one of each (the longest run into an empty column), for a stuck-game check.
playFreeCell関数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.
redCard関数Hearts and diamonds, the second and third suits.
replayFreeCell関数A game played out from its deal: every table it passed through, the first the deal, or null where the deal is not a deck or a move is one the rules refuse.
runLength関数How many cards on top of a column are in order, each on the one under it: the most a single carry could ever take.
solveFreeCell関数A winning line from this table — every move a replay of it makes, the safe ones home included — or null when none was found within budget tables.
suitOf関数A card's suit, 0 to 3 in SUITS order.
topOf関数The top card of a pile, or undefined where it holds none (a foundation's top is its suit at its count).

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

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