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 · FreeCell

fitsFoundationfunction

Whether a card may go onto its suit's foundation now.

Import it

import { fitsFoundation } from "@johnmorrisdotca/toranpu/freecell";

Definition

function fitsFoundation(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 may go onto its suit's foundation now.

Examples

import { fitsFoundation } from "@johnmorrisdotca/toranpu/freecell";

console.log(fitsFoundation(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.