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

encodeStackUpfunction

A game of Stack Up as text: its table, its seed and its moves, never a hand.

Import it

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

Definition

function encodeStackUp(game: StackUpGame): string

Parameters

NameTypeDescription
gameStackUpGame

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

Returns

string

A game of Stack Up as text.

Examples

import { encodeStackUp, startStackUp } from "@johnmorrisdotca/toranpu/stack-up";
console.log(encodeStackUp(startStackUp(15, ["Aki", "Ben"], undefined, 42)!).length > 0);
true

What it prints (run when this page was built)

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