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 · President

startPresidentfunction

A new game of President for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table President is not offered for. computers says, one a seat, which seats a computer plays; the third argument is unused.

Import it

import { startPresident } from "@johnmorrisdotca/toranpu/president";

Definition

function startPresident(size: number, players: readonly string[], _language?: unknown, dealt?: number, computers?: readonly boolean[]): PresidentGame | null

Parameters

NameTypeDescription
sizenumber

The game’s length or size, as defined by its table specification.

playersreadonly string[]

The player names in seat order.

_language (optional)unknown

An unused legacy language argument retained for compatibility.

dealt (optional)number | undefined

The numeric seed used to deal the game.

computers (optional)readonly boolean[] | undefined

Flags by seat: true where a computer controls that seat.

Returns

PresidentGame | null

A new game of President for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table President is not offered for. computers says, one a seat, which seats a computer plays; the third argument is unused.

Examples

import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu";
import { startPresident } from "@johnmorrisdotca/toranpu/president";

const names = Array.from({ length: CARD_GAME_TABLES.president.defaultPlayers }, (_, seat) => `Seat ${seat + 1}`);
console.log(startPresident(CARD_GAME_TABLES.president.defaultSize, names, undefined, 42)?.phase);
playing

What it prints (run when this page was built)

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