Reference · Cube engine and views
decodeCubeMovesfunction
The moves written in a code, or null where any of it is not a move.
Import it
import { decodeCubeMoves } from "@johnmorrisdotca/kyuubu";
Definition
function decodeCubeMoves(code: string): CubeMove[] | null
Parameters
| Name | Type | Description |
|---|---|---|
code | string | The encoded moves or standard notation to read. |
Returns
CubeMove[] | null
The moves written in a code, or null where any of it is not a move.
Examples
import { decodeCubeMoves, encodeCubeMoves, parseMoves } from "@johnmorrisdotca/kyuubu";
const moves = parseMoves("R U2", 3)!;
console.log(decodeCubeMoves(encodeCubeMoves(moves)));[ { axis: 0, layer: 2, turns: 3 }, { axis: 1, layer: 2, turns: 2 } ]What it prints (run when this page was built)