リファレンス
直方体のエンジン
import { … } from "@johnmorrisdotca/kyuubu/cuboid";
最小化と gzip 圧縮をしたサイズは 9.4 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
CUBOID_MAX_SIDE | 定数 | The most a side of a cuboid can be. |
CUBOID_MIN_SIDE | 定数 | The least a side of a cuboid can be. |
CUBOID_PRESETS | 定数 | The named cuboids, smallest first. |
CUBOID_RANDOM_STATE_MAX | 定数 | The most states a cuboid has and still has its scramble drawn uniformly out of all of them. |
CUBOID_WORDS | 定数 | The cuboid's words in both languages. |
CuboidDims | 型 | The width, height and depth of a cuboid, in cubies: each a whole number from 1 to 7. |
cuboidDragAngle | 関数 | The angle, in degrees, a picked layer has been dragged to: forwards is positive, and it stops at a half turn either way. |
CuboidDragPick | 型 | The layer a drag has picked: its axis and layer, the way across the screen (a unit vector, x right and y down) that turns it forwards by the right-hand rule, and whether it can only be turned by a half turn. |
CuboidFace | 型 | One face of a cuboid: how many columns and rows of stickers it has as it is seen from outside, and where its stickers begin in the state. |
cuboidFaceMove | 関数 | A face turned, depth layers in from it (1 is the face itself), on this cuboid: the move, or why not. |
cuboidFaces | 関数 | The six faces of a cuboid, in the order the state is written, with their size and where each begins. |
CuboidFault | 型 | Why a piece of notation is not a move on this cuboid. |
CuboidKeyReading | 型 | What a key means on a cuboid: a turn, a depth for the next face letter, or nothing. |
cuboidLayerOf | 関数 | The layer, 0 to the axis's depth − 1 from its negative side, that a cubie centre sits in. |
CuboidLineReading | 型 | What reading a line gives: its moves, or the first piece that is not one, where it began (counted in characters from 0) and why. |
cuboidMiddleMove | 関数 | The middle layer of an odd side, turned as M, E or S: the move, or why not. |
CuboidMove | 型 | One turn of a layer: its axis, its layer from the axis's negative side (0 to the axis's depth − 1), and one, two or three quarter turns by the right-hand rule. |
cuboidMoveForRelease | 関数 | The move a release makes: the picked layer turned by those quarters, or null for none. |
cuboidMoveLegal | 関数 | Whether a move can be made on this cuboid: its layer exists, is not the whole puzzle, and its turn is one that layer may make. |
cuboidMoveName | 関数 | What a move of a cuboid turns, in a few plain words, in English or Japanese: R2 is "Right face, twice", 2U2 "Up layer 2, twice", M2 "Middle slice, twice". |
cuboidMoveNotation | 関数 | A move as a person writes it on this cuboid: R, R', R2, 2U2, M2. |
cuboidMovesNotation | 関数 | Moves as a person writes them, a space between each. |
cuboidName | 関数 | A cuboid's name as it is written: 2×3×3. |
cuboidPastCommit | 関数 | Whether a held layer is past its point of no return: letting go now, at rest, makes a move. |
cuboidPermutationOf | 関数 | Where every sticker goes under a legal turn: to[i] is the slot the sticker in slot i lands on. |
cuboidPreset | 関数 | The named cuboid with this key, or undefined. |
CuboidPreset | 型 | THE NAMED CUBOIDS: the shapes people know, each with a name, the way it is best seen, and a line on what makes it different. |
cuboidQuartersForRelease | 関数 | What letting go makes of a dragged layer, as quarter turns from −2 to 2, where 0 is back where it was. |
CuboidReading | 型 | What reading one piece of notation gives: the move, or why it is not one. |
CuboidReplayFault | 型 | Why a cuboid replay could not be planned: which text would not read, where and why. |
CuboidReplayPlan | 型 | A cuboid solve ready to be played: a ReplayPlan whose size is the longest side, with the puzzle's own dims. |
CuboidReplaySource | 型 | What a cuboid replay is made from. |
cuboidScrambleLength | 関数 | How many turns a random walk that scrambles a cuboid has: 8, and 2.2 for every layer that is not the whole puzzle, up to 100. |
cuboidSlots | 関数 | Every sticker slot of a cuboid, in the order its state is written, and the way back from a slot to its place. |
cuboidSolved | 関数 | SOLVED: every face one colour, whichever colour it is, so a cuboid solved and then turned whole in the hand is still solved. |
cuboidStickerCount | 関数 | How many stickers a cuboid has: the area of its surface. |
CuboidWords | 型 | THE CUBOID'S OWN WORDS, in English and Japanese: what a screen reader calls it and what is said when a move cannot be made. |
faultSays | 関数 | The line that says why a piece of notation is not a move on a cuboid. |
HALF_TURN_COMMIT | 定数 | The point of no return of a half turn, in degrees: the middle of the way round. |
halfTurnOnly | 関数 | Whether a layer turns only by a half turn: it has a slice that is not square. |
hasRandomStateScramble | 関数 | Whether a cuboid has few enough states to be scrambled to one drawn uniformly out of all of them. |
isCuboidDims | 関数 | Whether this is a cuboid the package makes: three whole numbers from 1 to 7, and not 1×1×1, which has nothing to turn. |
isCuboidState | 関数 | Whether a string is a state of a cuboid this size: the right length, and each face's letter as many times as the face has stickers. |
legalCuboidMoves | 関数 | Every move a cuboid can make, by axis, layer and turn. |
legalTurns | 関数 | The turns a layer can make: [1, 2, 3] where its slice is square, [2] where it is not, and none where there is no such layer or the layer is the whole puzzle. |
parseCuboidDims | 関数 | A cuboid read from 2x3x3, 2×3×3, 2 3 3 or 2,3,3: its dims, or null where it is not one the package makes. |
parseCuboidMove | 関数 | One piece of notation as a move, or null where it is not one on this cuboid. |
parseCuboidMoves | 関数 | A line of notation as moves, or null where any of it is not a move on this cuboid. |
pickCuboidDrag | 関数 | The layer a drag across a sticker means, once it can be told: null while the pointer has not gone far enough, while the two layers that carry the sticker are too nearly as likely as each other, or where neither can turn. |
planCuboidReplay | 関数 | A scramble and a solve read, checked and timed. |
randomCuboidScramble | 関数 | A scramble. |
readCuboidKey | 関数 | What a key means on a cuboid, given the depth a digit before it set (1 where none did): the cube's keys (readKey) without the turns of the whole cube. |
readCuboidMove | 関数 | One piece of notation read for this cuboid: R, R', R2, 2R', M2. |
readCuboidMoves | 関数 | A line of notation read for this cuboid, saying which piece is wrong and why where one is. |
sameCuboid | 関数 | Whether two cuboids are the same puzzle turned about in the hand: the same three sides in any order. |
sliceOf | 関数 | The two axes a layer across axis is a slice of, and so what its slice measures: the other two sides. |
solvedCuboid | 関数 | A solved cuboid: each face one letter. |
turnAllCuboid | 関数 | The state after every turn in order. |
turnCuboid | 関数 | The state after one turn; an illegal turn throws a RangeError. |
undoCuboidMove | 関数 | The turn that takes one back. |
undoCuboidMoves | 関数 | A list of moves undone, last first. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。