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 · Cube engine and views

isCubeStatefunction

Whether a string is a state of a cube this size: the right length, and the right number of every colour.

Import it

import { isCubeState } from "@johnmorrisdotca/kyuubu";

Definition

function isCubeState(state: string, n: number): boolean

Parameters

NameTypeDescription
statestring

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

nnumber

The cube’s side length.

Returns

boolean

Whether a string is a state of a cube this size: the right length, and the right number of every colour.

Examples

import { isCubeState, solvedCube } from "@johnmorrisdotca/kyuubu";

const state = solvedCube(3);
console.log(isCubeState(state, 3));
true

What it prints (run when this page was built)

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