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

stackUpWantsfunction

What number a building pile wants next: one more than the cards on it.

Import it

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

Definition

function stackUpWants(pile: readonly CardId[]): number

Parameters

NameTypeDescription
pilereadonly string[]

The cards on the building pile.

Returns

number

What number a building pile wants next: one more than the cards on it.

Examples

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

What it prints (run when this page was built)

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