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

StackUpMovetype

One move at Stack Up: a card laid on a building pile (from the hand, the top of the stock, or the top of one of your own discard piles), a card put on a discard pile, which ends the turn, or a pass when there is nothing in hand to discard.

Import it

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

Definition

type StackUpMove = {
    play: CardId;
    from: "hand" | "stock";
    to: number;
} | {
    play: CardId;
    from: "discard";
    pile: number;
    to: number;
} | {
    discard: CardId;
    to: number;
} | {
    pass: true;
};

Examples

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

const value: StackUpMove = { play: "n01", from: "hand", to: 0 };
console.log(value);
{ play: 'n01', from: 'hand', to: 0 }

What it prints (run when this page was built)

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