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