Skip to the content

Toranpuトランプ

Use a deck, play eleven games with computers, solve a solitaire, or display cards in your own design.

Toranpu is Japanese for playing cards. About the name

Contents

Reference · Games and state

NewGameOptionstype

How to seat a new game. Everything but players has a sensible default.

Import it

import type { NewGameOptions } from "@johnmorrisdotca/toranpu";

Definition

type NewGameOptions = {
    players: readonly string[];
    size?: number;
    seed?: number;
    computers?: readonly boolean[];
};

Members

NameTypeDescription
playersreadonly string[]

One name a seat. The number of names is the number of players.

size (optional)number | undefined

How long the game lasts, in its own terms (CARD_GAME_TABLES); the usual length when left out.

seed (optional)number | undefined

The seed every deal is shuffled from; a random one when left out. The same seed deals the same cards.

computers (optional)readonly boolean[] | undefined

One a seat: true where a computer plays. Seats not given are people's.

Examples

import type { NewGameOptions } from "@johnmorrisdotca/toranpu";

const value: NewGameOptions = { players: ["Aki", "Ben", "Cy", "Dev"], seed: 42 };
console.log(value.seed);
42

What it prints (run when this page was built)

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