CuboidReplayPlan型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A cuboid solve ready to be played: a ReplayPlan whose size is the longest side, with the puzzle's own dims.
インポート
import type { CuboidReplayPlan } from "@johnmorrisdotca/kyuubu/cuboid";
定義
type CuboidReplayPlan = ReplayPlan & {
dims: CuboidDims;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size | number | The cube's side. |
scramble | SolveMove[] | The scramble's steps. |
steps | SolveMove[] | The solve's steps. |
start | string | The cube after the scramble: where a replay starts. |
scrambleStates | string[] | The cube after every step of the scramble, |
states | string[] | The cube after every step, |
solved | boolean | Whether the last of them is a solved cube, whichever way up. |
stepMs | number[] | How long each step takes at the solve's own pace, in milliseconds. |
totalMs | number | The whole time at the solve's own pace, in milliseconds. |
pace | "spread" | "given" | "default" | Whether the pace is the solve's own recorded time spread evenly, a time given for each step, or only a steady default. |
dims | CuboidDims | The puzzle's width, height and depth. |
例
import type { CuboidReplayPlan } from "@johnmorrisdotca/kyuubu/cuboid";
import { planCuboidReplay } from "@johnmorrisdotca/kyuubu/cuboid";
function requireCuboidPlan() {
const result = planCuboidReplay({ dims: [2, 3, 3], scramble: "R", solution: "R'" });
if (!result.ok) throw new Error("Invalid replay");
return result.plan;
}
const value: CuboidReplayPlan = requireCuboidPlan();
console.log(value.solved);true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。