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

isSafeHomefunction

Whether a card is one the solver treats as home safely: exported for its test.

Import it

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

Definition

function isSafeHome(card: number, foundation: readonly number[]): boolean

Parameters

NameTypeDescription
cardnumber

The packed card number from 0 to 51.

foundationreadonly number[]

The foundation index or state being checked.

Returns

boolean

Whether a card is one the solver treats as home safely: exported for its test.

Examples

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

console.log(isSafeHome(0, [0, 0, 0, 0]));
true

What it prints (run when this page was built)

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