playKlondikefunction
The table after a move, or null where the rules refuse it.
Import it
import { playKlondike } from "@johnmorrisdotca/toranpu/klondike";
Definition
function playKlondike(table: KlondikeTable, move: KlondikeMove): KlondikeTable | null
Parameters
| Name | Type | Description |
|---|---|---|
table | KlondikeTable | The native solitaire table; move helpers leave the input unchanged. |
move | KlondikeMove | The native move to validate or apply. |
Returns
KlondikeTable | null
The table after a move, or null where the rules refuse it.
Examples
import { dealKlondike, dealOfSeed, deckOf, movesFrom, playKlondike } from "@johnmorrisdotca/toranpu/klondike";
const table = dealKlondike(deckOf(dealOfSeed(42))!, { draw: 3, passes: 3 });
console.log(playKlondike(table, movesFrom(table)[0]!)?.stock.length);24What it prints (run when this page was built)