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

mountTenkafunction

A WHOLE TABLE OF TENKA IN PLAIN DOM: the map, whose turn it is and what to do, the players, your cards and the last dice, played against the computer (or by people taking turns on one device, with computers all false). No framework and no server; everything is in the element given.

Tap your own territory to place an army; to attack or move, tap where from, then where to, and choose from the buttons under the map. Under the players is the record of the game, which saves as JSON, text or CSV and loads a saved game back.

Import it

import { mountTenka } from "@johnmorrisdotca/tenka/ui";

Definition

function mountTenka(target: HTMLElement, options?: TenkaTableOptions): TenkaTableHandle

Parameters

NameTypeDescription
targetHTMLElement

The host element, including a host in a shadow root.

options (optional)TenkaTableOptions

Native game and presentation settings.

Returns

TenkaTableHandle

The table handle; destroy it when the host is removed.

Examples

import { mountTenka } from "@johnmorrisdotca/tenka/ui";
const show = (host: HTMLElement) => mountTenka(host, { seed: 7, record: false });
console.log(typeof show);
function

What it prints (run when this page was built)

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