playFreeCellfunction
The table after a move, or null where the rules refuse it.
Import it
import { playFreeCell } from "@johnmorrisdotca/toranpu/freecell";
Definition
function playFreeCell(table: FreeCellTable, move: FreeCellMove): FreeCellTable | null
Parameters
| Name | Type | Description |
|---|---|---|
table | FreeCellTable | The native solitaire table; move helpers leave the input unchanged. |
move | FreeCellMove | The native move to validate or apply. |
Returns
FreeCellTable | null
The table after a move, or null where the rules refuse it.
Examples
import { dealFreeCell, dealOfSeed, deckOf, movesFrom, playFreeCell } from "@johnmorrisdotca/toranpu/freecell";
const table = dealFreeCell(deckOf(dealOfSeed(42))!, 4);
console.log(playFreeCell(table, movesFrom(table)[0]!)?.tableau.map((column) => column.length));[
6, 7, 7, 7,
6, 6, 6, 6
]What it prints (run when this page was built)