本文へ移動

Meikyuu迷宮

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

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

目次

リファレンス · 迷路・矢印・混合の盤

MazeCoverage型

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

HOW MUCH OF THE MAP THE ANSWER COVERS (coverageOf): the second half of a maze's difficulty. The first half (difficultyOf's six terms) counts what a person meets on the way: forks, traps, wrong turns, bends, the size of it all. It cannot tell a maze whose answer crosses the whole map from one of the very same size whose answer stays in a corner and a short arm, and the second is the easier to play. John, 2026-10-06: a Huge cross maze whose answer sat in the middle and one arm, 134 cells of 4,736, read four dots of five. The family's rule, written once for every package with levels (LEVELS-STANDARD.md in johnmorrisdotca/.github), is: a level's difficulty counts how much of the map its answer covers.

Here that is two shares, each from 0 to 1, counted off the cell centres and the answer, so they are the same in every engine:

  • bbox: the box that holds the answer (and the trips to its keys) over the box that holds the maze, along each axis, as a geometric mean over the axes (two for a flat maze, three for a solid). An answer that stays on one side has a thin box.
  • zones: the maze is cut into a grid of zones, 2 by 2 under 150 cells, 3 by 3 under 800 and 4 by 4 above (2 by 2 by 2 under 200 cells and 3 by 3 by 3 above, for a solid), and a zone counts as visited when the answer has at least ZONE_VISIT cells in it. A zone with less than a quarter of an average zone's cells is left out, so a cross is cut to its arms and a ring to its ring. The share is of the cells' area, not of the zones. A solid's is divided by SOLID_ZONES_TOP (clamped to 1): a shell has no inside, so even a tour of all of it touches only about three quarters of the three-dimensional zones.

cover is the two averaged, with the bottom fifth taken off and the rest stretched to 0 to 1 ((0.5 * bbox + 0.5 * zones - 0.2) / 0.7, held between 0 and 1), and factor is 0.5 + 0.5 * cover: the difficulty is multiplied by it. A maze whose answer covers the map keeps its score; one whose answer stays in a corner counts for half. It is a factor and not a seventh term, because a term added would give every small maze a bonus (a small maze is covered by any answer) and a factor leaves them alone. docs/LEVELS.md explains the choices and the numbers.

インポート

import type { MazeCoverage } from "@johnmorrisdotca/meikyuu";

定義

type MazeCoverage = {
    bbox: number;
    zones: number;
    cover: number;
    factor: number;
};

メンバー

名前型説明
bboxnumber

The answer's box over the maze's, from 0 to 1.

zonesnumber

The share of the map's area, in zones the answer visits, from 0 to 1.

covernumber

The two, averaged and stretched, from 0 (a corner) to 1 (the whole map).

factornumber

What the score is multiplied by: 0.5 at no cover, 1 at all of it.

例

import type { MazeCoverage, MazeRecipe } from "@johnmorrisdotca/meikyuu";
import { buildMaze, coverageOf, solutionOf } from "@johnmorrisdotca/meikyuu";

const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const maze = buildMaze(recipe);
const grid = maze.grid;
const route = solutionOf(maze);
const value: MazeCoverage = coverageOf(grid.centres,route);
console.log(value);
{ bbox: 1, zones: 1, cover: 1, factor: 1 }

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

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

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