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
| Name | Type | Description |
|---|---|---|
moves | readonly CubeMove[] | The turns, in their execution order. |
n | number | 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"));nullWhat it prints (run when this page was built)