fitsColumnfunction
Whether a card may go onto a column: onto a card one higher of the other colour, or a King onto an empty one.
Import it
import { fitsColumn } from "@johnmorrisdotca/toranpu/klondike";
Definition
function fitsColumn(card: number, column: KlondikeColumn): boolean
Parameters
| Name | Type | Description |
|---|---|---|
card | number | The packed card number from 0 to 51. |
column | KlondikeColumn | The zero-based tableau column. |
Returns
boolean
Whether a card may go onto a column: onto a card one higher of the other colour, or a King onto an empty one.
Examples
import { fitsColumn } from "@johnmorrisdotca/toranpu/klondike";
console.log(fitsColumn(16, { down: 0, cards: [4] }));trueWhat it prints (run when this page was built)