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

RecordedMovetype

One move of a record: which seat made it, and the move.

Import it

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

Definition

type RecordedMove<K extends CardGameKind = CardGameKind> = {
    seat: number;
    move: MoveOf<K>;
};

Members

NameTypeDescription
seatnumber
moveMoveOf<K>

Examples

import { newGame, rulesFor } from "@johnmorrisdotca/toranpu";
import type { RecordedMove } from "@johnmorrisdotca/toranpu";

const game = newGame("hearts", { players: ["Aki", "Ben", "Cy", "Dev"], seed: 42 })!;
const value: RecordedMove<"hearts"> = { seat: 0, move: rulesFor("hearts").moves(game)[0]! };
console.log(value.seat);
0

What it prints (run when this page was built)

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