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

cubeSolvedfunction

SOLVED: every face one colour. Which colour does not matter, so a cube solved and then turned whole in the hand is still solved, and a 2×2 or 4×4, which has no fixed centres, is solved in whichever way round it ends.

Import it

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

Definition

function cubeSolved(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

SOLVED: every face one colour. Which colour does not matter, so a cube solved and then turned whole in the hand is still solved, and a 2×2 or 4×4, which has no fixed centres, is solved in whichever way round it ends.

Examples

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

const state = solvedCube(3);
console.log(cubeSolved(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.