replayfunction
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 { replay } from "@johnmorrisdotca/toranpu/klondike";
Definition
function replay(deal: string, rules: KlondikeRules, moves: string): KlondikeTable[] | null
Parameters
| Name | Type | Description |
|---|---|---|
deal | string | The deal number or dealing specification. |
rules | KlondikeRules | The game-specific rules or solver rules. |
moves | string | The ordered native moves to replay. |
Returns
KlondikeTable[] | 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 { dealOfSeed, encodeMoves, replay } from "@johnmorrisdotca/toranpu/klondike";
console.log(replay(dealOfSeed(42), { draw: 3, passes: 3 }, encodeMoves([{ kind: "draw" }]))?.length);2What it prints (run when this page was built)