parseCuboidMovefunction
One piece of notation as a move, or null where it is not one on this cuboid.
Import it
import { parseCuboidMove } from "@johnmorrisdotca/kyuubu/cuboid";
Definition
function parseCuboidMove(text: string, dims: CuboidDims): CuboidMove | null
Parameters
| Name | Type | Description |
|---|---|---|
text | string | The text to parse or format. |
dims | CuboidDims | The cuboid’s x, y and z dimensions, in that order. |
Returns
CuboidMove | null
One piece of notation as a move, or null where it is not one on this cuboid.
Examples
import { parseCuboidMove } from "@johnmorrisdotca/kyuubu/cuboid";
const dims = [2, 3, 3] as const;
console.log(parseCuboidMove("R", dims));{ axis: 0, layer: 1, turns: 3 }What it prints (run when this page was built)