本文へ移動

Toranpuトランプ

デッキを使い、11種類のゲームでコンピューターと対戦し、ソリティアを解いたり、独自の絵柄でカードを表示したりできます。

「トランプ」は、日本語で playing cards を指す言葉です。 名前について(英語)

目次

リファレンス · ビッグツー

startBigTwo関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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

インポート

import { startBigTwo } from "@johnmorrisdotca/toranpu/big-two";

定義

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

引数

名前型説明
sizenumber

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

playersreadonly string[]

The player names in seat order.

_language (省略可)unknown

An unused legacy language argument retained for compatibility.

dealt (省略可)number | undefined

The numeric seed used to deal the game.

computers (省略可)readonly boolean[] | undefined

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

戻り値

BigTwoGame | null

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

例

import { CARD_GAME_TABLES } from "@johnmorrisdotca/toranpu";
import { startBigTwo } from "@johnmorrisdotca/toranpu/big-two";

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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/toranpu 2.15.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。