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

STACK_UP_DECKconstant

The whole deck of 162 cards, in a fixed order: 1 to 12 twelve times over, then the wilds.

Import it

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

Definition

const STACK_UP_DECK: readonly string[] = [
    ...Array.from({ length: 12 }, () => Array.from({ length: STACK_UP_TOP }, (_, at) => `n${String(at + 1).padStart(2, "0")}`)).flat(),
    ...Array.from({ length: 18 }, () => STACK_UP_WILD),
]

Examples

import { STACK_UP_DECK } from "@johnmorrisdotca/toranpu/stack-up";
console.log(STACK_UP_DECK.length);
162

What it prints (run when this page was built)

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