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

permutationOffunction

Where every sticker goes under one turn: to[i] is the slot the sticker in slot i lands on. Worked out once and kept.

Import it

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

Definition

function permutationOf(n: number, move: CubeMove): Int32Array

Parameters

NameTypeDescription
nnumber

The cube’s side length.

moveCubeMove

The turn to apply, name or invert.

Returns

Int32Array<ArrayBufferLike>

Where every sticker goes under one turn: to[i] is the slot the sticker in slot i lands on. Worked out once and kept.

Examples

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

const move = parseMove("R", 3)!;
console.log(Array.from(permutationOf(3, move)).slice(0, 6));
[ 0, 1, 51, 3, 4, 48 ]

What it prints (run when this page was built)

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