Skip to the content

Toranpuトランプ

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

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Stack Up

stackUpFitsfunction

Whether a card may go on a building pile: a wild always, a number when it is the one the pile wants.

Import it

import { stackUpFits } from "@johnmorrisdotca/toranpu/stack-up";

Definition

function stackUpFits(card: CardId, pile: readonly CardId[]): boolean

Parameters

NameTypeDescription
cardstring

The card id to lay.

pilereadonly string[]

The cards on the building pile.

Returns

boolean

Whether a card may go on a building pile.

Examples

import { stackUpFits } from "@johnmorrisdotca/toranpu/stack-up";
console.log(stackUpFits("n01", []));
true

What it prints (run when this page was built)

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