movesFromfunction
Every move the rules allow from this table, in a fixed order: to the
foundations first, then onto the columns, then the stock. The table's own
list, for a solver and a stuck-game check; a person's move is checked by
playKlondike alone.
Import it
import { movesFrom } from "@johnmorrisdotca/toranpu/klondike";
Definition
function movesFrom(table: KlondikeTable): KlondikeMove[]
Parameters
| Name | Type | Description |
|---|---|---|
table | KlondikeTable | The native solitaire table; move helpers leave the input unchanged. |
Returns
KlondikeMove[]
Every move the rules allow from this table, in a fixed order: to the foundations first, then onto the columns, then the stock. The table's own list, for a solver and a stuck-game check; a person's move is checked by playKlondike alone.
Examples
import { dealKlondike, dealOfSeed, deckOf, movesFrom } from "@johnmorrisdotca/toranpu/klondike";
const table = dealKlondike(deckOf(dealOfSeed(42))!, { draw: 3, passes: 3 });
console.log(movesFrom(table).slice(0, 5));[
{ kind: 'carry', from: '1', to: '3' },
{ kind: 'carry', from: '2', to: '7' },
{ kind: 'carry', from: '3', to: '6' },
{ kind: 'draw' }
]What it prints (run when this page was built)