本文へ移動

Kyuubuキューブ

CSS 3Dのキューブをタッチ、キー、回転記号で回します。シードでスクランブルを再現し、名前付きの手順で解き方を追えます。

「キューブ」は、英語のcubeを表す日本語の表記です。 名前について(英語)

目次

リファレンス · 直方体の操作

CuboidPlayerOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

How a cuboid player is set up: the solve, and how it is shown.

インポート

import type { CuboidPlayerOptions } from "@johnmorrisdotca/kyuubu/cuboid/play";

定義

type CuboidPlayerOptions = CuboidReplaySource & {
    autoplay?: boolean;
    loop?: boolean;
    controls?: boolean;
    speed?: number;
    theme?: CubeTheme;
    cloth?: Cloth;
    readout?: boolean;
    moveList?: boolean;
    animateScrub?: boolean;
    locale?: KyuubuLanguage;
    onChange?: (status: ReplayStatus) => void;
    onEnd?: () => void;
};

メンバー

名前型説明
dimsCuboidDims

The puzzle's width, height and depth.

scramblestring

The scramble, as written.

solutionstring

The solve, as written.

timeMs (省略可)number | undefined

How long the solve took, in milliseconds, when that is known.

stepMs (省略可)readonly number[] | undefined

How long each step took, in milliseconds, when that is known; one for every step.

autoplay (省略可)boolean | undefined

Start playing as soon as it is drawn.

loop (省略可)boolean | undefined

Begin again when it ends.

controls (省略可)boolean | undefined

Show the controls: true unless said otherwise. A puzzle with none still plays when autoplay is set.

speed (省略可)number | undefined

The speed it starts at: 1 is the solve's own pace.

theme (省略可)CubeTheme | undefined

The puzzle's colours.

cloth (省略可)"green" | "blue" | "red" | "black" | "wood" | undefined

The cloth the stage behind the puzzle is laid in: "green", "blue", "red", "black" or "wood", the family's five. With none, the stage is clear.

readout (省略可)boolean | undefined

Show the code of the move just made in large type, with what it turns in words, and say it to a screen reader as it changes. True unless said otherwise; with controls: false, off unless this says true.

moveList (省略可)boolean | undefined

Show the moves as buttons, the one just made marked and scrolled into view, each one taking the replay to it. True unless said otherwise; with controls: false, off unless this says true.

animateScrub (省略可)boolean | undefined

Whether moving the slider, or choosing a move, turns the puzzle between where it was and where it goes. True unless said otherwise.

locale (省略可)KyuubuLanguage | undefined

English or Japanese; the page's lang when left out.

onChange (省略可)((status: ReplayStatus) => void) | undefined

Called after every step, and whenever it starts, stops or is moved.

onEnd (省略可)(() => void) | undefined

Called each time the end is reached.

例

import type { CuboidPlayerOptions } from "@johnmorrisdotca/kyuubu/cuboid/play";


const value: CuboidPlayerOptions = { dims: [2, 3, 3], scramble: "R", solution: "R'", autoplay: false };
console.log(value.dims);
[ 2, 3, 3 ]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/kyuubu 1.14.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。