Labyrinthian.Svg
1.3.0
dotnet add package Labyrinthian.Svg --version 1.3.0
NuGet\Install-Package Labyrinthian.Svg -Version 1.3.0
<PackageReference Include="Labyrinthian.Svg" Version="1.3.0" />
<PackageVersion Include="Labyrinthian.Svg" Version="1.3.0" />
<PackageReference Include="Labyrinthian.Svg" />
paket add Labyrinthian.Svg --version 1.3.0
#r "nuget: Labyrinthian.Svg, 1.3.0"
#:package Labyrinthian.Svg@1.3.0
#addin nuget:?package=Labyrinthian.Svg&version=1.3.0
#tool nuget:?package=Labyrinthian.Svg&version=1.3.0
Labyrinthian
Labyrinthian is a .NET Standard 2.1 C# library for generating mazes step-by-step. It provides a versatile toolkit for maze enthusiasts, game developers, and educators, allowing you to effortlessly create mazes with various algorithms and export them in SVG format.
This library is lightweight and comes with no external dependencies.
You can play around with a Blazor demo here.
Mazes, that were generated using Labyrinthian.Svg
Supported Maze Generation Algorithms
- Aldous Broder
- Binary tree
- Depth-first search
- Edge-based Prim's algorithm
- Growing tree
- Hunt and Kill
- Kruskal's algorithm
- Origin Shift (invented by CaptainLuma)
- Prim's algorithm
- Recursive backtracker (with customizable cell selection method)
- Recursive division
- Sidewinder
- Wilson's algorithm
Supported Maze Types
- Delta
- Sigma
- Orthogonal
- Theta
- Upsilon
Installation
Unity
- Download the Unity package here
- In Unity, go to 'Assets > Import package > Custom package'
- Select the downloaded package
- Click 'Import'
Visual Studio
- Open Package Manager Console window: 'View > Other Windows > Package Manager Console'
- Navigate to the directory in which the .csproj file exists
- Run this command to install the main package:
NuGet\Install-Package Labyrinthian
- If you need SVG-export features, also run this command:
NuGet\Install-Package Labyrinthian.Svg
.NET CLI
Run this command to install the main package:
dotnet add package Labyrinthian
If you need SVG-export features, also run this command:
dotnet add package Labyrinthian.Svg
Example
This code snippet demonstrates the creation, generation, and export of an orthogonal maze as an SVG file:
using Labyrinthian;
using Labyrinthian.Svg;
// Create an orthogonal maze 30x20
Maze maze = new OrthogonalMaze(30, 20);
// Generate it using Prim's algorithm
MazeGenerator generator = new PrimGeneration(maze);
generator.Generate();
// Create a maze exporter
MazeSvgExporter exporter = new(maze)
{
Walls.AsOnePath()
};
// Use a FileStream for exporting.
// You can also use any Stream or TextWriter(e.g. StreamWriter) or XmlWriter
using var fs = File.Create(@"d:\orthogonal-maze.svg");
using var svgWriter = new SvgWriter(fs);
// Export a maze
exporter.Export(svgWriter);
Possible output:
More examples here.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Labyrinthian (>= 1.2.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.