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'
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。