Reference · Rules, maps and records
replayTenkafunction
A game made again from its table and its moves, or null if any move could not have been made when it was.
Import it
import { replayTenka } from "@johnmorrisdotca/tenka";
Definition
function replayTenka(table: { rounds: number; players: readonly string[]; seed: number; placing: TenkaPlacing; map?: TenkaMapKey; }, moves: readonly TenkaMove[]): TenkaGame | null
Parameters
| Name | Type | Description |
|---|---|---|
table | { rounds: number; players: readonly string[]; seed: number; placing: TenkaPlacing; map?: TenkaMapKey; } | The original round limit, players, seed, placement and map. |
moves | readonly TenkaMove[] | The native moves in chronological order. |
Returns
TenkaGame | null
The replayed game, or null for invalid setup or any refused move.
Examples
import { replayTenka } from "@johnmorrisdotca/tenka";
console.log(replayTenka({rounds:10,players:["Seat 1","Seat 2"],seed:42,placing:"auto"},[] )?.seed);42What it prints (run when this page was built)