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

planCuboidReplayfunction

A scramble and a solve read, checked and timed. A solve that does not end on a solved puzzle is still planned, with solved: false; only text that cannot be read is refused, with the piece and what is wrong with it.

Import it

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

Definition

function planCuboidReplay(source: CuboidReplaySource): { ok: true; plan: CuboidReplayPlan; } | { ok: false; fault: CuboidReplayFault; }

Parameters

NameTypeDescription
sourceCuboidReplaySource

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

Returns

{ ok: true; plan: CuboidReplayPlan; } | { ok: false; fault: CuboidReplayFault; }

A scramble and a solve read, checked and timed. A solve that does not end on a solved puzzle is still planned, with solved: false; only text that cannot be read is refused, with the piece and what is wrong with it.

Examples

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

const dims = [2, 3, 3] as const;
console.log(planCuboidReplay({ dims: [2, 3, 3], scramble: "R", solution: "R'", timeMs: 1000 }));
{
  ok: true,
  plan: {
    dims: [ 2, 3, 3 ],
    size: 3,
    scramble: [ [Object] ],
    steps: [ [Object] ],
    start: 'UFUFUFRRRRRRRRRFDFDFDDBDBDBLLLLLLLLLUBUBUB',
    scrambleStates: [
      'UUUUUURRRRRRRRRFFFFFFDDDDDDLLLLLLLLLBBBBBB',
      'UFUFUFRRRRRRRRRFDFDFDDBDBDBLLLLLLLLLUBUBUB'
    ],
    states: [
      'UFUFUFRRRRRRRRRFDFDFDDBDBDBLLLLLLLLLUBUBUB',
      'UUUUUURRRRRRRRRFFFFFFDDDDDDLLLLLLLLLBBBBBB'
    ],
    solved: true,
    stepMs: [ 1000 ],
    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.