| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Demo online: https://dimonsmart.github.io/Demo/
MazeGenerator is a lightweight C# library for generating, visualizing, and solving mazes. The repo ships with a single CLI sample that walks through three small scenarios so you can verify the workflow without extra plumbing.
Run the text-mode sample (it plays all three scenarios back-to-back):
git clone https://github.com/DimonSmart/MazeGenerator.git
cd MazeGenerator
dotnet run --project QuickStartDemo --framework net8.0You will see:
The source lives in QuickStartDemo/Program.cs.
Install the package
dotnet add package DimonSmart.MazeGeneratorDefine a cell type (implements ICell, has a public parameterless constructor):
public sealed class TutorialCell : ICell
{
private bool _isWall;
public bool IsWall() => _isWall;
public void MakeWall() => _isWall = true;
}Generate a maze, compute a wave, and reconstruct the path:
var maze = new Maze<TutorialCell>(31, 21);
var options = new MazeBuildOptions(WallShortness: 0.15, Emptiness: 0.05);
new MazeBuilder<TutorialCell>(maze, options).Build();
var start = new Point(1, 1);
var end = new Point(maze.Width - 2, maze.Height - 2);
var wave = new MazeWaveGenerator<TutorialCell>(maze).GenerateWave(start.X, start.Y, end.X, end.Y);
var path = new MazePathBuilder(wave).BuildPath();Render however you like – iterate over maze to print ASCII (see the QuickStart demo) or handle plotter callbacks:
var plotter = new MyConsolePlotter();
await new MazeBuilder<TutorialCell>(maze).BuildAsync(plotter);
await new MazeWaveGenerator<TutorialCell>(maze, plotter).GenerateWaveAsync(start.X, start.Y, end.X, end.Y);
await new MazePathBuilder(wave, plotter).BuildPathAsync();MazeBuildOptions cheatsheet:
Issues and pull requests are welcome. Please include a short description of the scenario you verified (QuickStart example number, custom UI, etc.) so regressions stay easy to triage.
| Back | FazBrowse Home | New Git URL |