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

movesForReleasefunction

Every layer a release turns: the picked layer, and the one beside it where the drag took a seam, each by those quarters; none for none.

Import it

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

Definition

function movesForRelease(pick: DragPick, quarters: number): CubeMove[]

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[]

Every layer a release turns: the picked layer, and the one beside it where the drag took a seam, each by those quarters; none for none.

Examples

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

const pick = { axis: 0 as const, layer: 2, along: [1, 0] as [number, number] };
console.log(movesForRelease(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.