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

solveStepsfunction

The layer-by-layer solve of a 2×2 or 3×3 in this state, as steps a person can follow, or null for a size the method is not written for. Turning every step's moves in order, from state, leaves the cube solved.

Import it

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

Definition

function solveSteps(state: string, n: number): SolveStep[] | null

Parameters

NameTypeDescription
statestring

The sticker-state string in the package’s face order.

nnumber

The cube’s side length.

Returns

SolveStep[] | null

The layer-by-layer solve of a 2×2 or 3×3 in this state, as steps a person can follow, or null for a size the method is not written for. Turning every step's moves in order, from state, leaves the cube solved.

Examples

import { parseMove, solveSteps, solvedCube, turnCube } from "@johnmorrisdotca/kyuubu";

console.log(solveSteps(turnCube(solvedCube(2), 2, parseMove("R", 2)!), 2)?.map((step) => step.stage));
[ 'hold', 'whiteLayer' ]

What it prints (run when this page was built)

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