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

GameOftype

A game of that kind, in progress.

Import it

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

Definition

type GameOf<K extends CardGameKind> = CardGamePlays[K]["game"];

Examples

import { newGame } from "@johnmorrisdotca/toranpu";
import type { GameOf } from "@johnmorrisdotca/toranpu";

const game = newGame("hearts", { players: ["Aki", "Ben", "Cy", "Dev"], seed: 42 })!;
const value: GameOf<"hearts"> = game;
console.log(value.phase);
passing

What it prints (run when this page was built)

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