本文へ移動

Kyuubuキューブ

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

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

目次

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

fromText関数

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

A solve read back from plain lines, or null where they are not one. The size is a line such as 3x3 or 3×3 (a 3×3 where there is none), and scramble:, solve:, time: and seed: name the rest, in any order and either case. Lines with no name are turns of the solve, so a bare line of notation is read too.

インポート

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

定義

function fromText(text: string): SolveRecord | null

引数

名前型説明
textstring

The text to parse or format.

戻り値

SolveRecord | null

A solve read back from plain lines, or null where they are not one. The size is a line such as 3x3 or 3×3 (a 3×3 where there is none), and scramble:, solve:, time: and seed: name the rest, in any order and either case. Lines with no name are turns of the solve, so a bare line of notation is read too.

例

import { fromText, parseMoves, toText } from "@johnmorrisdotca/kyuubu";

const moves = parseMoves("R U2", 3)!;
const record = { size: 3, scramble: parseMoves("R", 3)!, moves: parseMoves("R'", 3)!, ms: 1000, seed: "docs" };
console.log(fromText(toText(record))?.size);
3

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

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

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