Reference · Cube engine and views
parseMovefunction
One move read back from the notation, for a cube of this size, or null
where it is not one: R, R', R2, 2R', M2, x'.
Import it
import { parseMove } from "@johnmorrisdotca/kyuubu";
Definition
function parseMove(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
One move read back from the notation, for a cube of this size, or null where it is not one: R, R', R2, 2R', M2, x'.
Examples
import { parseMove } from "@johnmorrisdotca/kyuubu";
console.log(parseMove("R'", 3));{ axis: 0, layer: 2, turns: 1 }What it prints (run when this page was built)