Reference · Cube engine and views
encodeCubeMovesfunction
Moves written three characters each, such as x23y02z*1: compact, and readable without knowing the cube's size.
Import it
import { encodeCubeMoves } from "@johnmorrisdotca/kyuubu";
Definition
function encodeCubeMoves(moves: readonly CubeMove[]): string
Parameters
| Name | Type | Description |
|---|---|---|
moves | readonly CubeMove[] | The turns, in their execution order. |
Returns
string
Moves written three characters each, such as x23y02z*1: compact, and readable without knowing the cube's size.
Examples
import { encodeCubeMoves, parseMoves } from "@johnmorrisdotca/kyuubu";
const moves = parseMoves("R U2", 3)!;
console.log(encodeCubeMoves(moves));x23y22What it prints (run when this page was built)