本文へ移動

Kyuubuキューブ

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

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

目次

リファレンス · 直方体のエンジン

cuboidQuartersForRelease関数

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

What letting go makes of a dragged layer, as quarter turns from −2 to 2, where 0 is back where it was. A layer that turns by quarters is read as the cube's is (quartersForRelease). One that only half turns is a half turn from HALF_TURN_COMMIT on, or from a flick (speed, in degrees a millisecond, signed like the angle) that has gone at least four times FLICK_ANGLE degrees the same way, and otherwise goes back.

インポート

import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";

定義

function cuboidQuartersForRelease(angle: number, speed: number, halfOnly: boolean, commitAngle?: number): -2 | -1 | 0 | 1 | 2

引数

名前型説明
anglenumber

The signed drag angle in degrees.

speednumber

The signed drag speed in degrees per millisecond.

halfOnlyboolean

Whether the layer can only make a half turn.

commitAngle (省略可)number

The drag angle in degrees at which a resting release commits a turn.

戻り値

0 | 1 | -1 | 2 | -2

What letting go makes of a dragged layer, as quarter turns from −2 to 2, where 0 is back where it was. A layer that turns by quarters is read as the cube's is (quartersForRelease). One that only half turns is a half turn from HALF_TURN_COMMIT on, or from a flick (speed, in degrees a millisecond, signed like the angle) that has gone at least four times FLICK_ANGLE degrees the same way, and otherwise goes back.

例

import { cuboidQuartersForRelease } from "@johnmorrisdotca/kyuubu/cuboid";

console.log(cuboidQuartersForRelease(100, 0, true));
2

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

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

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