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

turnAllfunction

The state after every turn in order.

Import it

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

Definition

function turnAll(state: string, n: number, moves: readonly CubeMove[]): string

Parameters

NameTypeDescription
statestring

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

nnumber

The cube’s side length.

movesreadonly CubeMove[]

The turns, in their execution order.

Returns

string

The state after every turn in order.

Examples

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

const state = solvedCube(3);
const moves = parseMoves("R U2", 3)!;
console.log(cubeSolved(turnAll(state, 3, [...moves, ...undoAll(moves)]), 3));
true

What it prints (run when this page was built)

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