homeMovefunction
The move that sends a top card home, if it can go: what a double tap does.
Import it
import { homeMove } from "@johnmorrisdotca/toranpu/klondike";
Definition
function homeMove(table: KlondikeTable, spot: TableSpot): KlondikeMove | null
Parameters
| Name | Type | Description |
|---|---|---|
table | KlondikeTable | The native solitaire table; move helpers leave the input unchanged. |
spot | TableSpot | The source or destination card location. |
Returns
KlondikeMove | null
The legal move to a foundation, or null when the selected top card cannot go home.
Examples
import { dealKlondike, dealOfSeed, deckOf, homeMove } from "@johnmorrisdotca/toranpu/klondike";
const table = dealKlondike(deckOf(dealOfSeed(42))!, { draw: 3, passes: 3 });
console.log(homeMove(table, { pile: "1", index: table.tableau[0]!.cards.length - 1 }));nullWhat it prints (run when this page was built)