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

tenkaToCSVfunction

A game as CSV, a row to a move, for a spreadsheet: TENKA_CSV_COLUMNS. Territories are written by key (alaska, westernCanada), seats from 1, dice as they fell, highest first and spaced. Lines end CRLF, as RFC 4180 has them, and a player's name that a spreadsheet would run as a formula is made safe with a leading apostrophe.

Import it

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

Definition

function tenkaToCSV(game: TenkaGame): string

Parameters

NameTypeDescription
gameTenkaGame

The current native game state.

Returns

string

A game as CSV, a row to a move, for a spreadsheet: TENKA_CSV_COLUMNS. Territories are written by key (alaska, westernCanada), seats from 1, dice as they fell, highest first and spaced. Lines end CRLF, as RFC 4180 has them, and a player's name that a spreadsheet would run as a formula is made safe with a leading apostrophe.

Examples

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

const game = startTenka(10,["Seat 1","Seat 2"],42)!;
console.log(tenkaToCSV(game));
move,round,seat,player,kind,from,to,armies,dice,attack,defend,attackerLost,defenderLost,throws,took,cards,out,winners

What it prints (run when this page was built)

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