Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Klondike

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

NameTypeDescription
cardnumber

The packed card number from 0 to 51.

columnKlondikeColumn

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] }));
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/toranpu 2.15.0.