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

movementSaysfunction

A movement in plain words, for a cube held with its front towards you: "Turn the right face away from you.", 「右の面を奥に回します。」. For a turn of the whole cube, where its faces go. Null for turns that are not one movement (different axes, or different amounts).

Import it

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

Definition

function movementSays(moves: readonly CubeMove[], n: number, language?: KyuubuLanguage): string | null

Parameters

NameTypeDescription
movesreadonly CubeMove[]

The turns, in their execution order.

nnumber

The cube’s side length.

language (optional)KyuubuLanguage

English or Japanese for the displayed words.

Returns

string | null

A movement in plain words, for a cube held with its front towards you: "Turn the right face away from you.", 「右の面を奥に回します。」. For a turn of the whole cube, where its faces go. null for turns that are not one movement (different axes, or different amounts).

Examples

import { movementSays, parseMoves } from "@johnmorrisdotca/kyuubu";

const moves = parseMoves("R U2", 3)!;
console.log(movementSays(moves, 3, "en"));
null

What it prints (run when this page was built)

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