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 · Cuboid engine

cuboidMoveForReleasefunction

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

Import it

import { cuboidMoveForRelease } from "@johnmorrisdotca/kyuubu/cuboid";

Definition

function cuboidMoveForRelease(pick: CuboidDragPick, quarters: number): CuboidMove | null

Parameters

NameTypeDescription
pickCuboidDragPick

The layer and screen direction selected by a drag.

quartersnumber

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

Returns

CuboidMove | null

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

Examples

import { cuboidMoveForRelease } from "@johnmorrisdotca/kyuubu/cuboid";

const cpick = { axis: 1 as const, layer: 0, along: [1, 0] as [number, number], halfOnly: true };
console.log(cuboidMoveForRelease(cpick, 2));
{ axis: 1, layer: 0, turns: 2 }

What it prints (run when this page was built)

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