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

cuboidMoveLegalfunction

Whether a move can be made on this cuboid: its layer exists, is not the whole puzzle, and its turn is one that layer may make.

Import it

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

Definition

function cuboidMoveLegal(dims: CuboidDims, move: CuboidMove): boolean

Parameters

NameTypeDescription
dimsCuboidDims

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

moveCuboidMove

The turn to apply, name or invert.

Returns

boolean

Whether a move can be made on this cuboid: its layer exists, is not the whole puzzle, and its turn is one that layer may make.

Examples

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

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

What it prints (run when this page was built)

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