Skip to the content

Kyuubuキューブ

Turn CSS 3D cubes by touch, keys or notation, reproduce a scramble from a seed, and follow a solve one named step at a time.

Kyuubu (キューブ) is the Japanese spelling of cube. About the name

Contents

Reference · Cube engine and views

seededRandomfunction

A SEEDED RANDOM SOURCE: the same seed gives the same numbers, in the same order, on every device and in every version from 1.1.0 on. Hand it to randomScramble and two people a world apart turn the same scramble.

The seed is any text. It is hashed to 32 bits (xmur3) and the numbers come from mulberry32: small, quick and even enough for a scramble. It is not for secrets.

Import it

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

Definition

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

Parameters

NameTypeDescription
seedstring

Text that reproduces the same random sequence.

Returns

() => number

A SEEDED RANDOM SOURCE: the same seed gives the same numbers, in the same order, on every device and in every version from 1.1.0 on. Hand it to randomScramble and two people a world apart turn the same scramble. The seed is any text. It is hashed to 32 bits (xmur3) and the numbers come from mulberry32: small, quick and even enough for a scramble. It is not for secrets.

Examples

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

console.log(seededRandom("docs")());
0.3628387039061636

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kyuubu 1.14.1.