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

fromJSONfunction

The solves in a JSON export, or null where the text is not one: not JSON, not this format, or a later one. Each solve is put together again from its size and its notation; one whose notation the cube cannot turn is left out, and what the file says of state, solved and count is ignored.

Import it

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

Definition

function fromJSON(text: string): SolveRecord[] | null

Parameters

NameTypeDescription
textstring

The text to parse or format.

Returns

SolveRecord[] | null

The solves in a JSON export, or null where the text is not one: not JSON, not this format, or a later one. Each solve is put together again from its size and its notation; one whose notation the cube cannot turn is left out, and what the file says of state, solved and count is ignored.

Examples

import { fromJSON, parseMoves, toJSON } from "@johnmorrisdotca/kyuubu";

const moves = parseMoves("R U2", 3)!;
const record = { size: 3, scramble: parseMoves("R", 3)!, moves: parseMoves("R'", 3)!, ms: 1000, seed: "docs" };
console.log(fromJSON(toJSON(record))?.length);
1

What it prints (run when this page was built)

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