playSpiderfunction
The table after a move, or null where the rules refuse it.
Import it
import { playSpider } from "@johnmorrisdotca/toranpu/spider";
Definition
function playSpider(table: SpiderTable, move: SpiderMove): SpiderTable | null
Parameters
| Name | Type | Description |
|---|---|---|
table | SpiderTable | The native solitaire table; move helpers leave the input unchanged. |
move | SpiderMove | The native move to validate or apply. |
Returns
SpiderTable | null
The table after a move, or null where the rules refuse it.
Examples
import { dealSpider, playSpider, spiderDealOfSeed, spiderDeckOf } from "@johnmorrisdotca/toranpu/spider";
const table = dealSpider(spiderDeckOf(spiderDealOfSeed(42, 1), 1)!);
console.log(playSpider(table, { kind: "deal" })?.stock.length);40What it prints (run when this page was built)