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
| Name | Type | Description |
|---|---|---|
game | TenkaGame | 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 42What it prints (run when this page was built)