本文へ移動

Kyuubuキューブ

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

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

目次

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

quartersForRelease関数

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

What letting go makes of a dragged layer: the quarter turns it snaps to, from −2 to 2, where 0 is back where it was and no move at all.

Short of the point of no return (commitAngle) it goes back; from there up to the same distance past a quarter turn it is one quarter turn; further is a half turn. A flick, still moving fast the way it was dragged, makes the quarter turn from short of the point. speed is in degrees a millisecond, signed like the angle.

インポート

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

定義

function quartersForRelease(angle: number, speed?: number, commitAngle?: number): -2 | -1 | 0 | 1 | 2

引数

名前型説明
anglenumber

The signed drag angle in degrees.

speed (省略可)number

The signed drag speed in degrees per millisecond.

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: the quarter turns it snaps to, from −2 to 2, where 0 is back where it was and no move at all. Short of the point of no return (commitAngle) it goes back; from there up to the same distance past a quarter turn it is one quarter turn; further is a half turn. A flick, still moving fast the way it was dragged, makes the quarter turn from short of the point. speed is in degrees a millisecond, signed like the angle.

例

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

console.log(quartersForRelease(60, 0));
1

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

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

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