planCuboidReplay関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
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 { planCuboidReplay } from "@johnmorrisdotca/kyuubu/cuboid";
定義
function planCuboidReplay(source: CuboidReplaySource): { ok: true; plan: CuboidReplayPlan; } | { ok: false; fault: CuboidReplayFault; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
source | CuboidReplaySource | The scramble and solution to plan, or the guide’s explicit moves or solving method. |
戻り値
{ 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.
例
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'
}
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。