newMazeGame関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A game of the maze, with nothing drawn, and, if given, the rules of its stones (stones.ts).
インポート
import { newMazeGame } from "@johnmorrisdotca/meikyuu";
定義
function newMazeGame<M extends MazeCore>(maze: M, rules?: StoneRules | null): MazeGame<M>
引数
| 名前 | 型 | 説明 |
|---|---|---|
maze | M | The valid flat/surface maze or required maze-core fields. |
rules (省略可) | StoneRules | null | Native stone limit/reach, or null when disabled. |
戻り値
MazeGame<M>
A game of the maze, with nothing drawn, and, if given, the rules of its stones (stones.ts).
例
import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";
import { buildMaze, newMazeGame } from "@johnmorrisdotca/meikyuu";
const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const maze = buildMaze(recipe);
console.log(newMazeGame(maze).path);[]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。