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

turnCubefunction

The state after one turn.

Import it

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

Definition

function turnCube(state: string, n: number, move: CubeMove): string

Parameters

NameTypeDescription
statestring

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

nnumber

The cube’s side length.

moveCubeMove

The turn to apply, name or invert.

Returns

string

The state after one turn.

Examples

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

const state = solvedCube(3);
const move = parseMove("R", 3)!;
console.log(turnCube(state, 3, move));
UUFUUFUUFRRRRRRRRRFFDFFDFFDDDBDDBDDBLLLLLLLLLUBBUBBUBB

What it prints (run when this page was built)

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