solveKlondikefunction
A winning line from this table — every move, the safe ones home included,
that a replay of it makes — or null when none was found within budget
tables. budget is a count, never a time, so every browser agrees.
Import it
import { solveKlondike } from "@johnmorrisdotca/toranpu/klondike";
Definition
function solveKlondike(start: KlondikeTable, budget?: number): { moves: KlondikeMove[] | null; tables: number; }
Parameters
| Name | Type | Description |
|---|---|---|
start | KlondikeTable | The initial game or state before the recorded moves. |
budget (optional) | number | Limits on the solver’s search work. |
Returns
{ moves: KlondikeMove[] | null; tables: number; }
A winning line from this table — every move, the safe ones home included, that a replay of it makes — or null when none was found within budget tables. budget is a count, never a time, so every browser agrees.
Examples
import { dealKlondike, dealOfSeed, deckOf, solveKlondike } from "@johnmorrisdotca/toranpu/klondike";
const table = dealKlondike(deckOf(dealOfSeed(42))!, { draw: 3, passes: 3 });
console.log(solveKlondike(table, 100));