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

recordOffunction

Every move of a game with the seat that made it, in order, found by playing the game through again from its seed. Null if the moves do not play out, which a game the rules made never does.

Import it

import { recordOf } from "@johnmorrisdotca/toranpu";

Definition

function recordOf<K extends CardGameKind>(kind: K, game: GameOf<K>): RecordedMove<K>[] | null

Parameters

NameTypeDescription
kindK

The named card game or sound kind.

gameGameOf<K>

The current native game; applying a move returns a new state.

Returns

RecordedMove<K>[] | null

Every move of a game with the seat that made it, in order, found by playing the game through again from its seed. null if the moves do not play out, which a game the rules made never does.

Examples

import { newGame, recordOf } from "@johnmorrisdotca/toranpu";

const game = newGame("hearts", { players: ["Aki", "Ben", "Cy", "Dev"], seed: 42 })!;
console.log(recordOf("hearts", game));
[]

What it prints (run when this page was built)

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