Side型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
One side of a cell: the cell across it (-1 for the edge of the shape) and the wall it is drawn with.
インポート
import type { Side } from "@johnmorrisdotca/meikyuu";
定義
type Side = {
readonly to: number;
readonly wall: Wall;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
to | number | |
wall | Wall |
例
import type { MazeRecipe, Side } from "@johnmorrisdotca/meikyuu";
import { buildMaze } 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 value: Side = grid.sides[0][0];
console.log(value);{ to: -1, wall: { a: [ 0, 0 ], b: [ 1, 0 ] } }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。