本文へ移動

Toranpuトランプ

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

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

目次

リファレンス · 積み上げ

StackUpGame型

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

A game of Stack Up: every seat's stock, hand and four discard piles, the four building piles, the cards still to draw and the finished piles waiting to be shuffled back in.

インポート

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

定義

type StackUpGame = KeptCardGame<StackUpMove> & {
    phase: "playing" | "over";
    toPlay: number | null;
    stocks: CardId[][];
    hands: CardId[][];
    discards: CardId[][][];
    building: CardId[][];
    draw: CardId[];
    done: CardId[];
    reshuffles: number;
    played: boolean;
    idle: number;
    ended: StackUpEnd | null;
};

メンバー

名前型説明
sizenumber
playersreadonly string[]
computersreadonly boolean[]
seednumber
movesreadonly StackUpMove[]
phase"playing" | "over"
toPlaynumber | null
stocksstring[][]

Each seat's stock, face down but for the top card, which is the last.

handsstring[][]
discardsstring[][][]

Each seat's four discard piles, the top card of each last.

buildingstring[][]

The four building piles: a pile of n cards wants an n + 1 next, up to 12.

drawstring[]
donestring[]

Finished piles of twelve, shuffled back into the draw pile when it runs out.

reshufflesnumber
playedboolean

Whether the seat to play has played a card this turn.

idlenumber

Turns in a row that ended with nothing played.

endedStackUpEnd | null

例

import type { StackUpGame } from "@johnmorrisdotca/toranpu/stack-up";
import { newGame } from "@johnmorrisdotca/toranpu";

const value: StackUpGame = newGame("stackUp", { players: ["Aki", "Ben"], seed: 42 })!;
console.log(value.building.length);
4

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

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

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