Reference · Surface maze rules and geometry
buildSolidMazefunction
Make the maze a recipe names.
Import it
import { buildSolidMaze } from "@johnmorrisdotca/meikyuu/3d";
Definition
function buildSolidMaze(recipe: SolidRecipe): SolidMaze
Parameters
| Name | Type | Description |
|---|---|---|
recipe | SolidRecipe | The complete reproducible native recipe. |
Returns
SolidMaze
Make the maze a recipe names.
Examples
import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";
import { buildMaze } from "@johnmorrisdotca/meikyuu";
import type { SolidRecipe } from "@johnmorrisdotca/meikyuu/3d";
import { buildSolidMaze } from "@johnmorrisdotca/meikyuu/3d";
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 solidRecipe: SolidRecipe = {kind:"cube",n:2,algorithm:"backtracker",seed:42};
console.log(buildSolidMaze(solidRecipe).grid.cells);24What it prints (run when this page was built)