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

encodeCubeMovesfunction

Moves written three characters each, such as x23y02z*1: compact, and readable without knowing the cube's size.

Import it

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

Definition

function encodeCubeMoves(moves: readonly CubeMove[]): string

Parameters

NameTypeDescription
movesreadonly CubeMove[]

The turns, in their execution order.

Returns

string

Moves written three characters each, such as x23y02z*1: compact, and readable without knowing the cube's size.

Examples

import { encodeCubeMoves, parseMoves } from "@johnmorrisdotca/kyuubu";

const moves = parseMoves("R U2", 3)!;
console.log(encodeCubeMoves(moves));
x23y22

What it prints (run when this page was built)

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