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

startSpadesfunction

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

Import it

import { startSpades } from "@johnmorrisdotca/toranpu/spades";

Definition

function startSpades(size: number, players: readonly string[], _language?: unknown, dealt?: number, computers?: readonly boolean[]): SpadesGame | 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

SpadesGame | null

A new game of Spades for these players (one name a seat) at this size, dealt from the seed dealt, or null for a table Spades 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 { startSpades } from "@johnmorrisdotca/toranpu/spades";

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

What it prints (run when this page was built)

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