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

tenkaCountfunction

A count said in the singular when it is one and the plural otherwise: tenkaCount(strings.countCardsOne, strings.countCards, 1) is "1 card". The line gets the number as {n}.

Import it

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

Also exported from: @johnmorrisdotca/tenka

Definition

function tenkaCount(one: string, other: string, n: number): string

Parameters

NameTypeDescription
onestring

The line for exactly one.

otherstring

The line for any other number, nought included.

nnumber

The number.

Returns

string

The count said in the singular when it is one and the plural otherwise.

Examples

import { TENKA_STRINGS, tenkaCount } from "@johnmorrisdotca/tenka/ui";

console.log(tenkaCount(TENKA_STRINGS.en.countCardsOne, TENKA_STRINGS.en.countCards, 1));
1 card

What it prints (run when this page was built)

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