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
| Name | Type | Description |
|---|---|---|
source | CuboidReplaySource | 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)