Skip to the content

Narabe並べ

Play forty-eight abstract board games through immutable moves, legal choices and replayable records.

Narabe means arranging in Japanese, as in gomoku-narabe: five in a row. About the name

Contents

Reference · Rules and records

seededRandomfunction

A small seeded random number generator, so anything a game decides by chance — where the dead squares fall, which pieces come next — is fixed by the seed stored with the game and comes out the same on every replay.

Mulberry32: fast, tiny, and good enough for a board game. The seed is a 31-bit integer.

Import it

import { seededRandom } from "@johnmorrisdotca/narabe";

Definition

function seededRandom(seed: number): () => number

Parameters

NameTypeDescription
seednumber

The numeric seed for a reproducible random stream.

Returns

() => number

A small seeded random number generator, so anything a game decides by chance — where the dead squares fall, which pieces come next — is fixed by the seed stored with the game and comes out the same on every replay. Mulberry32: fast, tiny, and good enough for a board game. The seed is a 31-bit integer.

Examples

import { seededRandom } from "@johnmorrisdotca/narabe";

console.log(seededRandom(42)());
0.6011037519201636

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/narabe 1.3.0.