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

turnCuboidfunction

The state after one turn; an illegal turn throws a RangeError. The state passed in is never changed.

Import it

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

Definition

function turnCuboid(state: string, dims: CuboidDims, move: CuboidMove): string

Parameters

NameTypeDescription
statestring

The sticker-state string in the package’s face order.

dimsCuboidDims

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

moveCuboidMove

The turn to apply, name or invert.

Returns

string

The state after one turn; an illegal turn throws a RangeError. The state passed in is never changed.

Examples

import { parseCuboidMove, solvedCuboid, turnCuboid } from "@johnmorrisdotca/kyuubu/cuboid";

const dims = [2, 3, 3] as const;
const cmove = parseCuboidMove("R", dims)!;
console.log(turnCuboid(solvedCuboid(dims), dims, cmove));
UFUFUFRRRRRRRRRFDFDFDDBDBDBLLLLLLLLLUBUBUB

What it prints (run when this page was built)

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