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
| Name | Type | Description |
|---|---|---|
state | string | The sticker-state string in the package’s face order. |
n | number | 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)