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

planReplayfunction

A scramble and a solve read, checked and timed. A solve that does not end on a solved cube is still planned, with solved: false, so that it can be shown and said to be unfinished; only text that cannot be read is refused.

Import it

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

Definition

function planReplay(source: ReplaySource): { ok: true; plan: ReplayPlan; } | { ok: false; fault: ReplayFault; }

Parameters

NameTypeDescription
sourceReplaySource

The scramble and solution to plan, or the guide’s explicit moves or solving method.

Returns

{ ok: true; plan: ReplayPlan; } | { ok: false; fault: ReplayFault; }

A scramble and a solve read, checked and timed. A solve that does not end on a solved cube is still planned, with solved: false, so that it can be shown and said to be unfinished; only text that cannot be read is refused.

Examples

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

console.log(planReplay({ size: 3, scramble: "R U", solution: "U' R'", timeMs: 1000 }));
{
  ok: true,
  plan: {
    size: 3,
    scramble: [ [Object], [Object] ],
    steps: [ [Object], [Object] ],
    start: 'UUUUUUFFFUBBRRRRRRRRRFFDFFDDDBDDBDDBFFDLLLLLLLLLUBBUBB',
    scrambleStates: [
      'UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB',
      'UUFUUFUUFRRRRRRRRRFFDFFDFFDDDBDDBDDBLLLLLLLLLUBBUBBUBB',
      'UUUUUUFFFUBBRRRRRRRRRFFDFFDDDBDDBDDBFFDLLLLLLLLLUBBUBB'
    ],
    states: [
      'UUUUUUFFFUBBRRRRRRRRRFFDFFDDDBDDBDDBFFDLLLLLLLLLUBBUBB',
      'UUFUUFUUFRRRRRRRRRFFDFFDFFDDDBDDBDDBLLLLLLLLLUBBUBBUBB',
      'UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB'
    ],
    solved: true,
    stepMs: [ 500, 500 ],
    totalMs: 1000,
    pace: 'spread'
  }
}

What it prints (run when this page was built)

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