Skip to the content

Kyuubuキューブ

Turn CSS 3D cubes by touch, keys or notation, reproduce a scramble from a seed, and follow a solve one named step at a time.

Kyuubu (キューブ) is the Japanese spelling of cube. About the name

Contents

Reference · Cuboid engine

parseCuboidMovesfunction

A line of notation as moves, or null where any of it is not a move on this cuboid.

Import it

import { parseCuboidMoves } from "@johnmorrisdotca/kyuubu/cuboid";

Definition

function parseCuboidMoves(text: string, dims: CuboidDims): CuboidMove[] | null

Parameters

NameTypeDescription
textstring

The text to parse or format.

dimsCuboidDims

The cuboid’s x, y and z dimensions, in that order.

Returns

CuboidMove[] | null

A line of notation as moves, or null where any of it is not a move on this cuboid.

Examples

import { parseCuboidMoves } from "@johnmorrisdotca/kyuubu/cuboid";

const dims = [2, 3, 3] as const;
console.log(parseCuboidMoves("R U2", dims));
[ { axis: 0, layer: 1, turns: 3 }, { axis: 1, layer: 2, turns: 2 } ]

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kyuubu 1.14.1.