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

MoveOftype

A move in a game of that kind.

Import it

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

Definition

type MoveOf<K extends CardGameKind> = CardGamePlays[K]["move"];

Examples

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

const game = newGame("hearts", { players: ["Aki", "Ben", "Cy", "Dev"], seed: 42 })!;
const value: MoveOf<"hearts"> = rulesFor("hearts").moves(game)[0]!;
console.log(value);
{ pass: [ '2C', '3C', '7C' ] }

What it prints (run when this page was built)

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