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

CliSurroundingstype

What the command line is told about where it runs. All of it may be left out.

Import it

import type { CliSurroundings } from "@johnmorrisdotca/kyuubu";

Definition

type CliSurroundings = {
    env?: Readonly<Record<string, string | undefined>>;
    stdin?: string;
    colour?: boolean;
    locale?: string;
    random?: () => number;
};

Members

NameTypeDescription
env (optional)Readonly<Record<string, string | undefined>> | undefined

The environment: LC_ALL, LC_MESSAGES and LANG choose the language, and NO_COLOR turns colour off.

stdin (optional)string | undefined

What was piped in, for --stdin.

colour (optional)boolean | undefined

Whether standard output is a terminal that shows colour. Piped output is never coloured.

locale (optional)string | undefined

The system's language, used where the environment names none (Windows).

random (optional)(() => number) | undefined

Where unseeded scrambles come from: a number in [0, 1), Math.random when left out.

Examples

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

const value: CliSurroundings = { env: {}, locale: "en", colour: false, random: seededRandom("docs") };
console.log(value.locale);
en

What it prints (run when this page was built)

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