solveSpiderfunction
A winning line from this table, or null when none was found within budget tables.
Import it
import { solveSpider } from "@johnmorrisdotca/toranpu/spider";
Definition
function solveSpider(start: SpiderTable, budget?: number): { moves: SpiderMove[] | null; tables: number; }
Parameters
| Name | Type | Description |
|---|---|---|
start | SpiderTable | The initial game or state before the recorded moves. |
budget (optional) | number | Limits on the solver’s search work. |
Returns
{ moves: SpiderMove[] | null; tables: number; }
A winning line from this table, or null when none was found within budget tables.
Examples
import { dealSpider, solveSpider, spiderDealOfSeed, spiderDeckOf } from "@johnmorrisdotca/toranpu/spider";
const table = dealSpider(spiderDeckOf(spiderDealOfSeed(42, 1), 1)!);
console.log(solveSpider(table, 100));