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
| Name | Type | Description |
|---|---|---|
kind | K | The named card game or sound kind. |
game | GameOf<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)