リファレンス
スパイダー
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。