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