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

playKlondikefunction

The table after a move, or null where the rules refuse it.

Import it

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

Definition

function playKlondike(table: KlondikeTable, move: KlondikeMove): KlondikeTable | null

Parameters

NameTypeDescription
tableKlondikeTable

The native solitaire table; move helpers leave the input unchanged.

moveKlondikeMove

The native move to validate or apply.

Returns

KlondikeTable | null

The table after a move, or null where the rules refuse it.

Examples

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

const table = dealKlondike(deckOf(dealOfSeed(42))!, { draw: 3, passes: 3 });
console.log(playKlondike(table, movesFrom(table)[0]!)?.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.