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

fromTextfunction

A solve read back from plain lines, or null where they are not one. The size is a line such as 3x3 or 3×3 (a 3×3 where there is none), and scramble:, solve:, time: and seed: name the rest, in any order and either case. Lines with no name are turns of the solve, so a bare line of notation is read too.

Import it

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

Definition

function fromText(text: string): SolveRecord | null

Parameters

NameTypeDescription
textstring

The text to parse or format.

Returns

SolveRecord | null

A solve read back from plain lines, or null where they are not one. The size is a line such as 3x3 or 3×3 (a 3×3 where there is none), and scramble:, solve:, time: and seed: name the rest, in any order and either case. Lines with no name are turns of the solve, so a bare line of notation is read too.

Examples

import { fromText, parseMoves, toText } 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(fromText(toText(record))?.size);
3

What it prints (run when this page was built)

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