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

moveForReleasefunction

The move a release makes: the picked layer turned by those quarters, or null for none.

Import it

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

Definition

function moveForRelease(pick: DragPick, quarters: number): CubeMove | null

Parameters

NameTypeDescription
pickDragPick

The layer and screen direction selected by a drag.

quartersnumber

The signed number of quarter turns on release; 0 cancels the move.

Returns

CubeMove | null

The move a release makes: the picked layer turned by those quarters, or null for none.

Examples

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

const pick = { axis: 0 as const, layer: 2, along: [1, 0] as [number, number] };
console.log(moveForRelease(pick, 1));
{ axis: 0, layer: 2, turns: 1 }

What it prints (run when this page was built)

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