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

randomBelowfunction

A whole number from 0 to below - 1, and the state after it.

Import it

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

Definition

function randomBelow(state: number, below: number): { value: number; state: number; }

Parameters

NameTypeDescription
statenumber

The seeded random generator state before the draw.

belownumber

The exclusive positive upper bound.

Returns

{ value: number; state: number; }

A whole number from 0 to below - 1, and the state after it.

Examples

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

console.log(randomBelow(42,6));
{ value: 3, state: 1831565855 }

What it prints (run when this page was built)

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