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

ScrubPathtype

The turns that take a cube from one position of a solve to another, for a slider that turns the cube as it moves.

Import it

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

Definition

type ScrubPath = {
    from: number;
    turns: CubeMove[][];
};

Members

NameTypeDescription
fromnumber

The position the cube is shown at to begin with: where it is, or, for a long jump, REPLAY_SCRUB_TURNS steps short of where it is going.

turnsCubeMove[][]

The turns to make from there, one entry for each step, in the order to make them; going back, each step is undone, the last first.

Examples

import type { ScrubPath } from "@johnmorrisdotca/kyuubu";
import { parseSolve, scrubPath } from "@johnmorrisdotca/kyuubu";

const value: ScrubPath = scrubPath(parseSolve("R U", 3).steps.map((step) => step.moves), 0, 2);
console.log(value.turns.length);
2

What it prints (run when this page was built)

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