本文へ移動

Meikyuu迷宮

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

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

目次

リファレンス

迷路・矢印・混合の盤

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

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

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

Meikyuu 迷宮, a maze game: the rules and the making, with no page needed.

エクスポート

名前種類概要
Arrow型One arrow: its cells from tail to head (indexes into the board, row by row), and the way its head points.
ARROW_HEARTS定数The hearts a puzzle starts with.
ARROW_SHAPES定数The pictures an arrow board can be: the whole square, or one of the shapes cut from it.
ARROW_STEPS定数The up, right, down and left row/column increments of arrow directions.
ArrowBoard型The native arrow recipe, shape mask, arrow paths and locked flags.
ArrowDirection型Which way an arrow's head points: up, right, down, left.
ArrowGame型AN ARROW PUZZLE BEING PLAYED, as pure functions.
ArrowMeasure型How hard an arrow puzzle is: the arrows to clear, the rounds of unblocking they take, and how many are blocked at the start.
ArrowRecipe型Everything that makes an arrow puzzle.
arrowRecipeCode関数A recipe as a short word, such as heart:15:6:77 or square:9x9:5:123:2 (the last number: how many are locked), and back.
ArrowShape型One of the supported flat arrow-board masks.
arrowsLeft関数The count of arrows still on the board.
ArrowTap型What a tap did.
autoTurn関数auto: turn a maze when that makes it bigger in the room there is.
below関数A whole number in [0, n) from the stream.
blockedBy関数The arrows on the way out of id that are still on the board.
blockersOf関数Which arrows block others: for each arrow, the arrows whose cells lie on its way out.
boundaryCells関数The cells with a side on the edge of the shape: where a door in the outer wall can be.
Box型A rectangle, in cells.
buildMaze関数Make the maze a recipe names.
buildMixed関数Build the maze and locked-arrow layers of one native mixed recipe.
canLayStone関数Whether a stone may be laid on a cell now, and if not, why not.
carveMaze関数The open neighbours of every cell, for a perfect maze of the grid made by this algorithm from this stream.
CellGraph型What a generator reads of a grid: how many cells there are and which are beside which.
cellsAlong関数The cells a pointer enters moving from one shown point to the next: the straight path between them cut into steps of a third of a cell and each step carried back into the maze.
centreCell関数The cell whose middle is nearest the middle of the shape.
circleGrid関数A circle maze: rings rings round a middle cell, cells running round each ring and out between the rings.
clearArrows関数Take every arrow off by tapping only free ones, the way a test or a demo plays.
clearStones関数Every stone taken up, in one step Undo can put back.
COVER_FROM定数Where cover begins to rise and how far it rises: (mean - COVER_FROM) / COVER_SPAN.
COVER_SPAN定数The native coverage span used by the geometry-aware score.
COVERAGE_FLOOR定数What the score is multiplied by at no cover at all.
coverageOf関数How much of a map an answer covers.
decodeRun関数The game a run text says, for maze under rules, or null when it is not a run of that maze: a step into a wall or back onto the line, a stone on a cell the line is on, on the start or the goal, on no cell at all or twice, or any stones when rules is null.
DIFFICULTY_CEILINGS定数The count at which a term reaches its full weight, on its log scale.
DIFFICULTY_WEIGHTS定数What each term is weighed by in the score; they add to 1.
difficultyOf関数How hard a maze is, from 0 to 100, and what that is made of.
difficultyOfGraph関数The same for any maze, flat or over a solid, given how it lies in space (MazeGeometry).
Door型A door in the outer wall: the cell it is beside, and which of that cell's sides.
dragMaze関数The finger moved into a cell.
easyFloorAt関数What the easy third asks for beyond the least, rising through it so that it climbs: at place place (from 1) of a size, a maze has at least this many traps, forks and wasted cells, and from the end of the easy third the least.
EFFORT_LEAST定数The easiest effort a level is given a rating for, and the hardest: 1 and 100 are these.
EFFORT_MOST定数The upper native effort bound used when converting effort to a rating.
encodeRun関数A run kept as one short text: the line as its steps (lineToSteps), and, if any stones are down, a ~ and their cells in base 36 joined by dots, such as 0231~1a.2f.
Grid型The native flat cell graph with geometry, neighbour sides, bounds and point-to-cell lookup.
gridOf関数A grid by name.
hasStone関数Whether a cell has a stone on it.
headOf関数The end of the line, or null while there is none.
heldByLocks関数Whether an arrow cannot be cleared before the unlock whatever the player taps: with every free arrow taken off, one after another, it is still on the board.
hexGrid関数Columns by rows of hexagons, pointy side up, every odd row shifted half a cell right.
hintArrow関数The arrow to tap next: one that is free now and keeps the most arrows waiting behind it, so it also frees the most others.
hintMaze関数Where to look next: how many cells of the line to draw back (the part that has strayed from the way to what is still needed), and the next stretch of the right way from there, up to ahead cells, not counting the one the line is on.
isFree関数Whether an arrow can be tapped now and slide off: it is on the board, not locked, and nothing is in front of it.
isPerfect関数Whether the passages are a spanning tree of the grid: every cell reached, and exactly one way to each.
isTooEasy関数Whether a maze is too easy to be a level: it falls short of any of MEIKYUU_LEAST, or, with a place in the easy third of a size, of easyFloorAt(place).
layoutCells関数How many cells laying out a recipe's grid takes, counted before anything is built: the grid's own cells for squares, hexagons, triangles and circles, and the whole raster for a shape cut out of one (a cut-out shape keeps fewer, but is built from all of them).
layStone関数The game with a stone laid on the cell; the same game when it may not be (canLayStone).
liftMaze関数The finger lifted.
lineToSteps関数A line, cell by cell from the start, as its steps.
Links型Each cell's open neighbours.
makeArrows関数The arrows of a recipe, in the order they were added: the last one added is free from the start.
Mask型THE OUTLINES cut out of a square raster: a function from a point of the square (both numbers from -1 to 1, y down) to whether that point is inside the shape.
maskOf関数The outline a raster shape is cut with.
Maze型A seeded flat maze with its cell graph, passages, doors, endpoints and optional keys.
MazeCore型What the game, the stones, the measure and the steps read of a maze: the passages, the two ends, the keys, and how many cells there are and which are beside which.
MazeCoverage型HOW MUCH OF THE MAP THE ANSWER COVERS (coverageOf): the second half of a maze's difficulty.
MazeDifficulty型HOW HARD A MAZE IS TO PLAY, ON ONE SCALE FROM 0 TO 100 (difficultyOf).
MazeGame型A MAZE BEING DRAWN, as pure functions: each takes a game and returns a new one (or the same one, when nothing changed), so a page, a server and a test play by the same rules.
MazeGeometry型How a maze lies in space, which is all the measure needs to know of it besides the passages: how far a cell is from the goal (any measure that rises with distance will do, the squared distance is cheapest) and how far the line bends going from one cell through another to a third, in radians from 0 (straight on) to pi (back the way it came).
MazeMeasure型HOW HARD A MAZE IS, measured from the maze alone (docs/MAZES.md says why each number is here).
mazeProgress関数How far the line has got, for a progress line: cells drawn, keys, and whether it is solved.
MazeRecipe型Everything that makes a maze.
measureArrows関数Measure the arrow count, cells, dependency rounds and native clearing effort.
measureMaze関数Measure a maze.
measureMixed関数How hard it is: the arrows' effort and half the labyrinth's.
MEIKYUU_ALGORITHMS定数THE SEVEN WAYS TO MAKE A PERFECT MAZE, each over any grid: a perfect maze is a spanning tree of the cells, so there is exactly one way between any two of them.
MEIKYUU_EASY_PLACES定数How far up a size the easy third reaches: its first 86 places.
MEIKYUU_LEAST定数The least a maze must have to be a level at all, wherever it is in a list (isTooEasy): the straight guess draws at least four cells it did not need, is wrong at two forks or more, and the way has three places to choose, three wrong branches and four dead ends.
MEIKYUU_MODES定数A MAZE: a grid, the passages carved through it (always a spanning tree, so exactly one way between any two cells), and how it is played.
MEIKYUU_MOST_ARROW_CELLS定数The most cells an arrow board may have: a little over twice the biggest level's (1,849).
MEIKYUU_MOST_CELLS定数The most cells a recipe may lay out: a little over twice what the biggest level does (19,321, a heart, leaf, star or moon cut from a raster 139 across).
MEIKYUU_MOST_KEYS定数The most keys a recipe may ask for: twice the most any level uses (five).
MEIKYUU_ORIENTATIONS定数WHICH WAY UP A MAZE IS LOOKED AT.
MEIKYUU_SHAPES定数Every shape a maze can be made on.
MEIKYUU_STONE_REACH_MOST定数The farthest a stone may be from the line: two cells.
MeikyuuAlgorithm型One of the seven native maze-carving algorithms.
MeikyuuMode型The enter/leave, goal, centre-out or key-collecting native maze mode.
MeikyuuOrientation型The native portrait, landscape or automatic board orientation.
MeikyuuShape型A supported flat grid geometry or cut-out mask.
MixedBoard型A native mixed recipe with its flat maze and arrow layers.
MixedGame型The current native maze and arrow states of one mixed puzzle.
MixedRecipe型THE MIXED PUZZLE: an arrow board with some arrows locked, and a labyrinth beside it with an unlock button hidden deep inside.
mixedRecipeCode関数Encode a native mixed maze/arrow recipe as reproducible text.
mixedSolved関数Whether the puzzle is won: every arrow cleared.
newArrowGame関数Create the native arrow state with all arrows present and a starting heart count.
newMazeGame関数A game of the maze, with nothing drawn, and, if given, the rules of its stones (stones.ts).
newMixedGame関数Create the native game states for both layers of a mixed board.
parseArrowRecipe関数A recipe's arrow board from its code, or null when it is not one, or names a board bigger than MEIKYUU_MOST_ARROW_CELLS.
parseMixedRecipe関数Read native mixed-recipe text, or null for a malformed maze/arrow recipe.
parseRecipe関数A recipe from its code, or null when it is not one, or names a maze bigger than MEIKYUU_MOST_CELLS or more keys than MEIKYUU_MOST_KEYS.
passageCount関数How many passages the maze has: one fewer than its cells, if it is perfect.
peelRounds関数The order the arrows come off in if every free one is taken each round, as rounds: the length of this is how many times the board has to be looked at again.
pick関数One of the items, chosen from the stream.
playSolution関数Draw the maze's whole solution through the game, a cell at a time, as a finger would: the way a test or a demo plays.
Point型A point, [x, y], in cells.
pressMaze関数A finger down on a cell: it begins a stroke if the cell is the start, the line's end, or on the line.
Random型A number in [0, 1), like Math.random, from a stream a seed fixes.
ratingOf関数An effort as a rating from 1 to 100, on a scale where doubling the effort adds the same each time.
rayOf関数The cells in front of an arrow's head, out to the edge of the board, nearest first.
recipeCode関数A recipe as one short word, such as square:12x9:wilson:to-goal:48213 or heart:25:prim:keys-3:7, and the other way (parseRecipe).
resolveTurn関数The turn an orientation means for a maze, given the room when it is auto.
restartArrows関数Restore every native arrow and the original hearts, clearing mistakes and removals.
restartMaze関数Everything off the maze again.
ringCounts関数How many cells each ring of a circle maze holds: one in the middle, six round it, and a ring doubles its cells when its cells would otherwise be wider than tall.
seededRandom関数A stream of numbers in [0, 1) fixed by a seed.
shuffled関数A copy of the list in a random order (Fisher–Yates); the list given is left alone.
Side型One side of a cell: the cell across it (-1 for the edge of the shape) and the wall it is drawn with.
SOLID_ZONES_TOP定数How much of a solid's zones even a whole tour touches.
solutionOf関数The one way from the start to the goal, cell by cell, both ends included.
squareGrid関数Columns by rows of square cells.
stepsToLine関数The cells steps walk from the maze's start, or null if any step goes where a line cannot: into a wall, off the maze, or back onto the line.
stoneLimitFor関数How many stones a maze of cells cells gets by default: three, and one more for every hundred cells across (so four for a small maze, nine for a huge one, thirteen for a colossal one).
StoneOption型What the stones option of mountMeikyuu takes: true for the defaults, or any of the rules (limit: null for no limit).
StoneRules型STONES: a marble laid on a cell of the maze that the line may not enter.
stoneRulesOf関数The rules an option means for a maze of cells cells, or null when the option is no stones.
stonesLeft関数How many stones can still be laid: null for no limit, and nought for a game with none.
StoneVerdict型Why a stone cannot be laid on a cell, or ok.
takeStone関数The game with the stone on the cell taken up (and given back); the same game when there is none.
TALL_RATIO定数The ratio of a tall container, width over height: two to three.
TALL_SHAPES定数The shapes that are made tall.
TALL_WIDTHS定数How many cells across each size of the tall levels is.
tallDimensions関数The columns and rows of a maze of shape for the size width (a square maze of that size is width by one and a half times that): as near 2:3 as its cells allow, and with about as many cells as that square maze has (width times one and a half width), so that the sizes are as big to draw whatever the shape is.
tapArrow関数Attempt to remove a native arrow and return the new game and removed/blocked/locked/ignored result.
tapMaze関数A tap on a cell: the line runs along the passage toward it as far as the next place it could have gone another way, or to the cell itself if that comes first.
toDisplay関数A logical point as it is shown.
toggleStone関数A tap on a cell: a stone there is taken up, and otherwise one is laid.
toLogical関数A point of the picture as the maze has it: the inverse of toDisplay.
triangleGrid関数Rows of triangles, each pointing up or down in turn, w to a row; a cell is up when its column and row make an even number.
Turn型0 for a maze shown as it was made, 1 for a quarter turn counter-clockwise.
turnedBox関数The rectangle a logical rectangle takes when shown.
turnFor関数Whether to turn a maze box (as made) for an orientation.
turnTransform関数The SVG transform that shows a logical drawing turned, or none.
undoArrow関数Put the last arrow taken back, and give back no heart.
undoMaze関数Put the whole line back as it was before the last stroke.
unlockArrows関数Let the locked arrows be tapped.
unturnedBox関数The logical rectangle a shown rectangle covers: the inverse of turnedBox.
VERSION定数The package's version.
walk関数How far every cell is from from along the passages, and the cell before it on the way: -1 where unreachable.
Wall型The line a wall is drawn along, from a to b.
withArrows関数The arrows changed.
withMaze関数The labyrinth changed: when its button is reached, every locked arrow is unlocked.
withStoneRules関数The same game under other rules (the limit or the reach changed, or stones turned on or off): the stones down stay down, and none is ever taken off by a lower limit, only no more laid.
ZONE_REAL定数A zone with less than this share of an average zone's cells is not a zone (a cross's corners, a ring's hole).
ZONE_VISIT定数The cells of the answer a zone must hold to be visited.
zonesAcross関数How many zones along each axis a map of cells is cut into: a flat map by 2, 3 or 4, a solid by 2 or 3.

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

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