DimonSmart.MazeGenerator
1.24804.1641
Prefix Reserved
See the version list below for details.
dotnet add package DimonSmart.MazeGenerator --version 1.24804.1641
NuGet\Install-Package DimonSmart.MazeGenerator -Version 1.24804.1641
<PackageReference Include="DimonSmart.MazeGenerator" Version="1.24804.1641" />
paket add DimonSmart.MazeGenerator --version 1.24804.1641
#r "nuget: DimonSmart.MazeGenerator, 1.24804.1641"
// Install DimonSmart.MazeGenerator as a Cake Addin #addin nuget:?package=DimonSmart.MazeGenerator&version=1.24804.1641 // Install DimonSmart.MazeGenerator as a Cake Tool #tool nuget:?package=DimonSmart.MazeGenerator&version=1.24804.1641
MazeGenerator
MazeGenerator is a C# library designed to create complex mazes programmatically. This project also includes a console application demo that showcases how mazes are generated and visualized dynamically.
Features
- Dynamic Maze Generation: Generate mazes with customizable dimensions and complexity.
- Visualization: Console application for visualizing maze generation and pathfinding processes.
- Extensible Architecture: Easily extendable to integrate different types of maze algorithms and visualization methods.
- Pathfinding Support: Includes pathfinding capabilities to find routes through the mazes.
Getting Started
Prerequisites
- .NET Core SDK (version specified or latest)
Installation
Clone the repository and navigate to the project directory:
git clone https://github.com/DimonSmart/MazeGenerator.git
cd MazeGenerator
Running the Demo
To see the MazeGenerator in action:
- Open the solution in Visual Studio or any compatible IDE.
- Set MazeGeneratorConsoleDemo as the startup project.
- Build and run the application to visualize the maze generation and pathfinding.
Key Components
Classes and Interfaces
Maze
: Represents the maze structure with methods for wall creation and query.Cell
: Basic unit in a maze implementing the ICell interface.MazeBuilder<T>
: Generic builder class for constructing mazes with specific characteristics and algorithms.MazePathFinder
: Static class providing pathfinding functionality within the maze using wave propagation.IMazePlotter
: Interface for plotting elements like walls and passages within the maze, synchronously or asynchronously.
Usage
Add a reference to the MazeGenerator project in your application. Utilize the classes to generate and manipulate mazes:
using DimonSmart.MazeGenerator;
using DimonSmart.MazeGeneratorConsoleDemo;
// Create a new maze with dimensions 31x21 using the user defined Cell class
var maze = new Maze(31, 21, () => new Cell());
// Initialize the maze plotter
var mazePlotter = new MazeConsolePlotter(TimeSpan.FromMilliseconds(25));
// Build the maze with specific generation options
new MazeBuilder<Cell>(maze, new MazeBuildOptions(0.50, 0.0)).Build(mazePlotter);
// Find a path from start to a specified end point
var result = maze.FindPath(1, 1, GetEndPointCriteria(29, 19), wave => {
wave.VisualizeWave(mazePlotter);
Thread.Sleep(500);
});
if (result != null)
{
result.VisualizePath(mazePlotter);
}
// Keep the console open for 10 seconds
Console.CursorVisible = true;
Thread.Sleep(10000);
// Helper function to define endpoint criteria
private static Func<int, int, bool> GetEndPointCriteria(int endX, int endY)
{
return (x, y) => x == endX && y == endY;
}
Contributions
Contributions are welcome! Please fork the repository and submit pull requests with your enhancements.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.24817.745 | 172 | 8/17/2024 |
1.24812.924 | 127 | 8/12/2024 |
1.24808.2114 | 123 | 8/8/2024 |
1.24807.2038 | 98 | 8/7/2024 |
1.24807.1946 | 95 | 8/7/2024 |
1.24806.2143 | 94 | 8/6/2024 |
1.24806.2056 | 90 | 8/6/2024 |
1.24804.1641 | 70 | 8/4/2024 |
1.24801.1815 | 91 | 8/1/2024 |
1.24801.1531 | 85 | 8/1/2024 |
1.24801.1520 | 85 | 8/1/2024 |
1.24731.1325 | 80 | 7/31/2024 |
1.24731.1030 | 82 | 7/31/2024 |
1.24731.1007 | 82 | 7/31/2024 |
1.24731.939 | 70 | 7/31/2024 |
1.24731.929 | 70 | 7/31/2024 |