本文へ移動

Kyuubuキューブ

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

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

目次

リファレンス · キューブのエンジンと表示

Guideクラス

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

A guide through a list of moves or the method's steps, for a cube of side n starting from state.

インポート

import { Guide } from "@johnmorrisdotca/kyuubu";

定義

class Guide
new Guide(state: string, n: number, source: GuideSource): Guide

引数

名前型説明
statestring

The initial sticker-state string.

nnumber

The cube’s side length.

sourceGuideSource

Explicit guide moves or the solving method.

メンバー

名前型説明
nnumber

The cube's side.

statestring

The cube as the guide has it: where it started, with every turn it has been told of or has handed out.

nextGuideStep | null

The movement to make now, or null when there is nothing left to make. While there is a detour it is still the movement to come back to.

detoursreadonly CubeMove[]

The turns made that were not asked for, oldest first.

donenumber

How many movements have been finished, over every step of the method.

finishedboolean

Whether there is nothing left to make.

heard(move: CubeMove): GuideHeard

A turn made on the cube, by a person or anything else, told to the guide. "done": that finished the movement, and next is the one after. "part": it was part of it, and next asks for the rest. "off": it was not asked for, and is kept as a detour. "back": it undid the last detour.

takeBack(): CubeMove[]

The turns that take every detour back, last first, as the guide now has them made: turn them on the cube without telling the guide again.

makeNext(): CubeMove[]

Every detour taken back and the movement made, as the guide now has it: the turns to make on the cube, without telling the guide again.

例

import { Guide, parseMove, solvedCube } from "@johnmorrisdotca/kyuubu";

const guide = new Guide(solvedCube(3), 3, { moves: "R U" });
console.log(guide.next?.text);
console.log(guide.heard(parseMove("R", 3)!));
R
done

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

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

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