本文へ移動

Meikyuu迷宮

シード付きの迷路と矢印パズルを作り、番号付きの問題を進め、平面や立体表面で遊べます。

「迷宮」は迷路のように入り組んだ場所を表す言葉です。 名前について(英語)

目次

リファレンス

立体表面の規則と形

import { … } from "@johnmorrisdotca/meikyuu/3d";

最小化と gzip 圧縮をしたサイズは 20.3 kB(読み込むものをすべて含み、esbuild で計測)

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

Meikyuu over the surface of a solid: a perfect maze on a cube, a globe, the other dice (a tetrahedron, an octahedron, an icosahedron, a ten-sided, a twelve-sided and more) or a shape (a box, a cross of cubes, a ring, a torus, a star, a heart), with the line drawn from one face to the next across the edges. The graph of the surface (solidGridOf), the maze made on it by the very algorithms the flat mazes use (buildSolidMaze, SolidRecipe), the measure of how hard it is (solidDifficultyOf), the arithmetic of looking at a turned solid and of finding the cell under a finger (projectFrame, pickCell), the checker for an answer (checkSolidAnswer) and a still picture as SVG (drawSolid). The game itself (drawing, undo, stones, steps) is the root entry's: it plays any maze, flat or not. The board to play in a page is @johnmorrisdotca/meikyuu/3d/play, and the numbered levels are in @johnmorrisdotca/meikyuu/3d/levels.

エクスポート

名前種類概要
buildSolidMaze関数Make the maze a recipe names.
cachedSolidGrid関数The grid of a solid cut n ways, kept: a grid is never changed, and a script that makes thousands of mazes of one size builds it once.
cellsAlongDrag関数The cells a straight drag from one point to another crosses, in order, by sampling it finely enough that no cell the drag passes through is missed.
checkSolidAnswer関数Whether a list of cells is the answer: it starts at the start, ends at the goal, steps from each cell to one joined to it by a passage, and never visits a cell twice.
createFrame関数Room for a frame of a solid.
dragTurn関数The turn a drag from one point to another makes: the point of the solid under the first is carried to under the second.
drawSolid関数Render a surface maze and optional trail/stones as native SVG text.
DrawSolidOptions型A MAZE OVER A SOLID AS SVG TEXT, a still picture of it from one side: the near side's cells shaded by how squarely they face the viewer, the walls that stand, and, if asked, the line, the stones and the way through.
EDGE_FULL定数The normalized threshold used for a full native edge turn.
EDGE_NEIGHBOUR定数The normalized neighbouring-cell edge-turn threshold.
EDGE_RATE定数The fastest the solid turns by itself, in radians a second.
EDGE_SAFE定数THE SOLID TURNS BY ITSELF to keep the end of a line being drawn in view.
edgeTurn関数Compute a view rotation that follows a surface path near an edge, or null when no turn is needed.
faceCellTurn関数The turn that brings the cell round to face the viewer (see facingOf for around), by the shortest way, and then rolls it so that a side of the cell lies level (the cell's own first side, to the nearest of the turns that put one of its sides level).
isSolidCut関数Whether a solid can be cut n ways: a whole number of at least 2, or 1 where the solid has already sixty cells uncut (the dodecahedron's five to a face).
isSolidDie関数Whether a solid is among the dice (the rest are shapes).
MEIKYUU_MOST_SOLID_CELLS定数The most cells a solid may have in a recipe: a little over twice the biggest level.
MEIKYUU_SOLID_PER_LIST定数How many levels each size of each solid has: eight pages of eight.
openingTurn関数A view of the solid to begin with: the cell faces the viewer, then the solid is tipped a little so that its depth shows and its neighbours on the near side can be seen.
parseSolidRecipe関数A recipe from its code, or null when it is not one, or names a solid of more than MEIKYUU_MOST_SOLID_CELLS cells.
pickCell関数The cell the point (x, y) of the picture is on, or -1 for none.
projectFrame関数Put the solid, turned by q and zoomed, on a picture width by height: fills every array of the frame.
Quat型A rotation: [x, y, z, w], of length one.
QUAT_IDENTITY定数The rotation that does nothing.
quatAngle関数How far apart two rotations are, in radians, from 0 to pi.
quatAxisAngle関数The turn of angle radians about an axis (any length but nought).
quatBetween関数The shortest turn that carries the direction a onto the direction b.
quatMul関数Two rotations in turn: b after a.
quatNormalize関数A rotation made one again: the turns a drag adds up carry a little error, which this takes out.
quatSlerp関数Halfway (or any share) from one rotation to another along the shortest way.
quatTurn関数A point turned.
SOLID_ALGORITHMS定数The algorithms that make a maze over a solid: all but Eller's, which needs rows.
SOLID_CUTS定数How many ways each solid is cut, for each size: small, medium, large, huge and colossal.
SOLID_DICE定数The dice, by how many sides, smallest first.
SOLID_DIE_SIDES定数How many sides a die has (what its name on a die is: d6).
SOLID_EYE定数How far the eye is from the middle of the solid, in times its reach.
SOLID_FILL定数The share of the box the solid's outline fills at most.
SOLID_FIRST定数THE SOLIDS BY HOW THEY ARE MET.
SOLID_KINDS定数THE SURFACE OF A SOLID AS A CELL GRAPH: the one thing a maze over a solid is made on.
SOLID_MORE_DICE定数The seven dice that came after the first five, and the six shapes.
SOLID_MORE_SHAPES定数The additional box, cross, ring, torus, star and heart surface families.
SOLID_SHAPES定数The shapes.
SOLID_SIZE_NAMES定数THE SIZES OF THE LEVELS OF A SOLID: three to each, small, medium and large, cut so that they come to about the same number of cells whichever solid it is (under a hundred, about three hundred, and six to seven hundred), and so that the one kind of solid is not the easy one: a cube cut 4, 7 and 10 ways has 96, 294 and 600 cells, a globe at frequency 3, 5 and 8 has 92, 252 and 642, an octahedron cut 3, 6 and 9 has 72, 288 and 648.
SOLID_ZOOM_LEAST定数How far in and out the picture can be zoomed, as a multiple of the fitted size: in to six, so that a cell of a colossal solid (about six pixels across when the whole solid is in the box) is a finger wide (about 24) at four and has room beyond.
SOLID_ZOOM_MOST定数The maximum native surface-view zoom factor.
SolidAlgorithm型A maze-carving algorithm supported on a surface graph.
solidAnswerSteps関数The answer as steps (the format a kept run uses, lineToSteps), for a maze: its whole solution.
solidCells関数How many cells a solid cut n ways has.
solidCellsOf関数How many cells a solid has at a size.
solidCutOf関数The cut of a solid at a size.
solidDifficultyOf関数How hard a maze over a solid is to play, from 0 to 100, on the very scale flat mazes are scored on (difficultyOf).
SolidEdge型The edge between two cells: its two corners (indices into vertices) and the two cells it lies between.
SolidFrame型Where a solid is, as a picture of a given size: the turn, the zoom, and every corner and cell as it lands.
solidGeometry関数How a maze over a solid lies in space, for the measure: squared distance through space to the goal, and the bend of the line in three dimensions.
SolidGrid型A surface cell graph, neighbouring faces, vertices, projected centres and shape geometry.
solidGridOf関数The surface of a solid cut n ways (n at least 2, or 1 for a solid with sixty cells at that): its cells, which are beside which, and where each lies.
SolidKind型A supported polyhedron, die or shaped surface for a maze.
SolidMaze型A maze over a solid: what a flat maze has that is not flat.
SolidRecipe型Everything that makes a maze over a solid.
solidRecipeCode関数A recipe as one short word, such as cube:6:prim:48213, and the other way (parseSolidRecipe).
SolidSize型A named small, medium, large, huge or colossal surface-maze collection.
solidSolutionOf関数The one way from the start to the goal, cell by cell.
stepTurn関数A turn about the viewer's own axes: right radians about the vertical (the solid's near side moves right) and down about the horizontal.
trackballPoint関数The point of the trackball a point of the picture is on, for turning by a drag: the unit sphere seen from the front, and, outside it, the rim.
Vec3型A point or a direction in three dimensions.

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

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