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

Getting started

Getting started

Install Tenka, start a seeded game and play one legal move.

Tenka is a seeded world-conquest engine for two to six players. The core uses plain data and needs no DOM, clock or runtime dependency. A separate table entry draws and plays the game.

Install

npm install @johnmorrisdotca/tenka

Use Node 22 or later or modern browsers. React is an optional peer for the React entry; Korokoro and Toranpu are optional peers for dice/card dressing.

import {startTenka,tenkaMoves,playTenka} from "@johnmorrisdotca/tenka";
let game = startTenka(10,["Seat 1","Seat 2"],42);
if (!game) throw new Error("Invalid setup");
const move = tenkaMoves(game)[0];
const next = playTenka(game,move);
if (next) game = next;
console.log(game.phase,game.moves.length);
reinforce 1

startTenka takes rounds, players and seed, in that order. It returns null for invalid setup; playTenka returns null for a refused move. Keep the returned game only when non-null. The players are local names, not shared identifiers.

Pick a recipe

Turns, battles/cards, records, daily games, tables/embeds and the reference cover the next steps.

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