freeCellLiftablefunction
The cards a person can take hold of from a spot, the one held and every one on it, or none: a free cell's card, or a column's card with the run in order on top of it. A foundation's cards stay home.
Import it
import { freeCellLiftable } from "@johnmorrisdotca/toranpu/freecell";
Definition
function freeCellLiftable(table: FreeCellTable, spot: FreeCellSpot): readonly number[]
Parameters
| Name | Type | Description |
|---|---|---|
table | FreeCellTable | The native solitaire table; move helpers leave the input unchanged. |
spot | FreeCellSpot | The source or destination card location. |
Returns
readonly number[]
The cards a person can take hold of from a spot, the one held and every one on it, or none: a free cell's card, or a column's card with the run in order on top of it. A foundation's cards stay home.
Examples
import { dealFreeCell, dealOfSeed, deckOf, freeCellLiftable } from "@johnmorrisdotca/toranpu/freecell";
const table = dealFreeCell(deckOf(dealOfSeed(42))!, 4);
console.log(freeCellLiftable(table, { pile: "1", index: table.tableau[0]!.length - 1 }));[ 32 ]What it prints (run when this page was built)