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 · Browser table and SVG

TenkaTableOptionstype

Native table settings; defaults to three players, with two computers.

Import it

import type { TenkaTableOptions } from "@johnmorrisdotca/tenka/ui";

Definition

type TenkaTableOptions = {
    players?: readonly string[];
    computers?: readonly boolean[];
    rounds?: number;
    seed?: number;
    map?: TenkaMapKey;
    colours?: readonly string[];
    computerDelayMs?: number;
    onChange?: (game: TenkaGame) => void;
    locale?: TenkaLocale;
    strings?: Partial<TenkaStrings>;
    theme?: Readonly<Record<string, string>>;
    record?: boolean;
    dressing?: TenkaDressing;
};

Members

NameTypeDescription
players (optional)readonly string[] | undefined

The names round the table, in seat order: two to six.

computers (optional)readonly boolean[] | undefined

Which seats the computer plays. By default every seat but the first.

rounds (optional)number | undefined

Rounds before the count: 10, 20, or 60 for the whole world.

seed (optional)number | undefined

The seed every deal and die is drawn from; a new one each game when absent.

map (optional)TenkaMapKey | undefined

The map: "world" (the default) or "europe".

colours (optional)readonly string[] | undefined

A colour for each seat.

computerDelayMs (optional)number | undefined

How long the computer waits before each of its moves, in milliseconds.

onChange (optional)((game: TenkaGame) => void) | undefined

Told of every game after a move.

locale (optional)TenkaLocale | undefined

The language of the table: "en" or "ja". By default the page's own (<html lang>), and English for any other.

strings (optional)Partial<TenkaStrings> | undefined

Words of your own, laid over the locale's: any of TenkaStrings.

theme (optional)Readonly<Record<string, string>> | undefined

CSS variables set on the table itself, which win in light and dark alike: { "--tk-sea": "#23405a" }.

record (optional)boolean | undefined

Whether the table shows the record of the game, with saving and loading. True by default.

dressing (optional)TenkaDressing | undefined

How the dice and the cards are drawn, if not the plain way: tenkaDressing() from @johnmorrisdotca/tenka/dressing draws them with Korokoro's dice and Toranpu's cards. The game is the same either way.

Examples

import type { TenkaTableOptions } from "@johnmorrisdotca/tenka/ui";
const options: TenkaTableOptions = { seed: 7, record: false };
console.log(options.seed);
7

What it prints (run when this page was built)

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