Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · FreeCell

replayFreeCellfunction

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. The one reader of a move list, for the table, a kept run, the check and a finished game's page alike.

Import it

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

Definition

function replayFreeCell(deal: string, cells: number, moves: string): FreeCellTable[] | null

Parameters

NameTypeDescription
dealstring

The deal number or dealing specification.

cellsnumber

The number of available free cells.

movesstring

The ordered native moves to replay.

Returns

FreeCellTable[] | null

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. The one reader of a move list, for the table, a kept run, the check and a finished game's page alike.

Examples

import { dealFreeCell, dealOfSeed, deckOf, encodeMoves, movesFrom, replayFreeCell } from "@johnmorrisdotca/toranpu/freecell";

const table = dealFreeCell(deckOf(dealOfSeed(42))!, 4);
console.log(replayFreeCell(dealOfSeed(42), 4, encodeMoves(movesFrom(table).slice(0, 1)))?.length);
2

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.