stockMovefunction
What a press on the stock does: turn it, or turn the waste back over, or nothing once the passes are spent.
Import it
import { stockMove } from "@johnmorrisdotca/toranpu/klondike";
Definition
function stockMove(table: KlondikeTable): KlondikeMove | null
Parameters
| Name | Type | Description |
|---|---|---|
table | KlondikeTable | The native solitaire table; move helpers leave the input unchanged. |
Returns
KlondikeMove | null
The legal stock or recycle move, or null when no stock action is available.
Examples
import { dealKlondike, dealOfSeed, deckOf, stockMove } from "@johnmorrisdotca/toranpu/klondike";
const table = dealKlondike(deckOf(dealOfSeed(42))!, { draw: 3, passes: 3 });
console.log(stockMove(table));{ kind: 'draw' }What it prints (run when this page was built)