Skip to the content

Tenka天下

Play seeded world conquest for two to six, with dice battles, cards, computer players and saved games.

Tenka means the world under heaven in Japanese. About the name

Contents

Reference · Rules, maps and records

decodeTenkafunction

A kept game read back, or null for nothing kept, or for text that is not a game these rules can play out again: a browser's storage is somebody's to edit, and a half-understood game is worse than none.

Import it

import { decodeTenka } from "@johnmorrisdotca/tenka";

Definition

function decodeTenka(text: string | null): TenkaGame | null

Parameters

NameTypeDescription
textstring | null

The encoded game text to validate and replay.

Returns

TenkaGame | null

The reconstructed game, or null for absent, malformed, unsupported or illegal saved data.

Examples

import { decodeTenka, encodeTenka, startTenka } from "@johnmorrisdotca/tenka";

const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(decodeTenka(encodeTenka(game))?.seed);
42

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/tenka 2.2.0.