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

ReplayCubetype

The part of a cube's view a replay needs: CubeView is one.

Import it

import type { ReplayCube } from "@johnmorrisdotca/kyuubu";

Definition

type ReplayCube = {
    setState(state: string, size?: number): void;
    turnTogether(moves: readonly CubeMove[], options?: {
        animate?: boolean;
        ms?: number;
    }): void;
    readonly busy?: boolean;
};

Members

NameTypeDescription
setState(state: string, size?: number): void
turnTogether(moves: readonly CubeMove[], options?: { animate?: boolean; ms?: number; }): void
busy (optional)boolean | undefined

Whether a turn asked for is still on its way; a cube that does not say is taken to be at rest.

Examples

import type { ReplayCube } from "@johnmorrisdotca/kyuubu";
import { movesNotation } from "@johnmorrisdotca/kyuubu";

const value: ReplayCube = { setState: (state) => console.log(state), turnTogether: (moves) => console.log(movesNotation(moves, 3)) };
console.log(typeof value.turnTogether);
function

What it prints (run when this page was built)

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