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
| Name | Type | Description |
|---|---|---|
from | number | The position the cube is shown at to begin with: where it is, or, for a long jump, |
turns | CubeMove[][] | 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);2What it prints (run when this page was built)