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

tenkaToTextfunction

A game as plain text, a line to a move, for a chat or a log: who placed what where, every throw of the dice, every territory taken, and how it ended. In English unless given another table of strings (TENKA_STRINGS.ja). Lines end with a line feed.

Import it

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

Definition

function tenkaToText(game: TenkaGame, strings?: TenkaStrings): string

Parameters

NameTypeDescription
gameTenkaGame

The current native game state.

strings (optional)TenkaStrings

The localized words used to format names or the record.

Returns

string

A game as plain text, a line to a move, for a chat or a log: who placed what where, every throw of the dice, every territory taken, and how it ended. In English unless given another table of strings (TENKA_STRINGS.ja). Lines end with a line feed.

Examples

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

const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(tenkaToText(game));
Tenka: Seat 1, Seat 2; 10 rounds; seed 42

What it prints (run when this page was built)

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