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

dealKlondikefunction

Deal a deck (card numbers, the first dealt first) into a table: column by column along each row, as a dealer does.

Import it

import { dealKlondike } from "@johnmorrisdotca/toranpu/klondike";

Definition

function dealKlondike(deck: readonly number[], rules: KlondikeRules): KlondikeTable

Parameters

NameTypeDescription
deckreadonly number[]

The deck in its current order; the input is left unchanged.

rulesKlondikeRules

The game-specific rules or solver rules.

Returns

KlondikeTable

Deal a deck (card numbers, the first dealt first) into a table: column by column along each row, as a dealer does.

Examples

import { dealKlondike, dealOfSeed, deckOf } from "@johnmorrisdotca/toranpu/klondike";

console.log(dealKlondike(deckOf(dealOfSeed(42))!, { draw: 3, passes: 3 }).stock.length);
24

What it prints (run when this page was built)

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