本文へ移動

Meikyuu迷宮

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

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

目次

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

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. They differ in the texture of what they make, which is written up in docs/MAZES.md:

  • backtracker: walk till stuck, then back up. Long winding passages, few dead ends.
  • hunt: hunt-and-kill. Much the same, a little less winding.
  • growing: growing tree, taking the newest cell half the time and a random one the rest: in between.
  • prim: randomized Prim, taking a random edge from the frontier. Very many short dead ends.
  • kruskal: joins random edges that join different pieces. Many short dead ends, evenly spread.
  • wilson: loop-erased random walks. Every maze equally likely, so no texture of its own.
  • eller: one row at a time. Squares only: it needs rows.

They return each cell's open neighbours. Nothing here reads a cell's position.

インポート

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

定義

const MEIKYUU_ALGORITHMS: readonly ["backtracker", "hunt", "growing", "prim", "kruskal", "wilson", "eller"] = ["backtracker", "hunt", "growing", "prim", "kruskal", "wilson", "eller"] as const

例

import { MEIKYUU_ALGORITHMS } from "@johnmorrisdotca/meikyuu";
console.log(MEIKYUU_ALGORITHMS);
[
  'backtracker',
  'hunt',
  'growing',
  'prim',
  'kruskal',
  'wilson',
  'eller'
]

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

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

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