Reference · Cube engine and views
parseMovesfunction
A line of notation read back, or null where any of it is not a move on this cube.
Import it
import { parseMoves } from "@johnmorrisdotca/kyuubu";
Definition
function parseMoves(text: string, n: number): CubeMove[] | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The text to parse or format. |
n | number | The cube’s side length. |
Returns
CubeMove[] | null
A line of notation read back, or null where any of it is not a move on this cube.
Examples
import { parseMoves } from "@johnmorrisdotca/kyuubu";
console.log(parseMoves("R U2", 3));[ { axis: 0, layer: 2, turns: 3 }, { axis: 1, layer: 2, turns: 2 } ]What it prints (run when this page was built)