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

playStackUpfunction

The game after a move, or null for a move the rules refuse. A card played from the last of a hand draws five more; the last card of a stock ends the game; a building pile of twelve is set aside.

Import it

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

Definition

function playStackUp(game: StackUpGame, move: StackUpMove): StackUpGame | null

Parameters

NameTypeDescription
gameStackUpGame

The current native game; applying a move returns a new state.

moveStackUpMove

The move to apply.

Returns

StackUpGame | null

The game after a move, or null for a move the rules refuse.

Examples

import { playStackUp, stackUpMoves, startStackUp } from "@johnmorrisdotca/toranpu/stack-up";

const game = startStackUp(15, ["Aki", "Ben"], undefined, 42)!;
console.log(playStackUp(game, stackUpMoves(game)[0]!)?.moves.length);
1

What it prints (run when this page was built)

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