mazelib: A library for 2D maze generation and solving
This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.
>>>
:{
let result = generateMaze AldousBroder (3, 3) $ Just (mkStdGen 123) in case result of Left e -> do putStrLn e Right (maze, exits) -> let path = cleanPath $ solveMaze maze exits Nothing in do putStrLn $ mazeToString maze exits (Just path) :} +++++++ SOOOOO+ +++++O+ +OOO+O+ +O+O+O+ +O+OOO+ +E+++++
An (N x M) Maze is represented in memory as a (2N + 1 x 2M + 1) boolean matrix.
In an idealized maze, walls are 0 width, but in memory they are width 1, thus
the larger size. From this we infer that coordinates (x, y) where both x and y
are odd integers map to the coordinates in the ideal maze -- i.e.
(x, y) -> (x - 1 $
. div
2, y - 1 $ div
2)
Properties
Versions | 0.1.0.0 |
---|---|
Change log | CHANGELOG.md |
Dependencies | base (>=4.16.4.0 && <4.17), random (>=1.2.0.0 && <1.3) [details] |
License | GPL-3.0-or-later |
Author | Kevin Vicente |
Maintainer | kvicente@fastmail.com |
Category | Library |
Source repo | head: git clone https://github.com/ImJustTrying/Mazelib.git |
Uploaded | by kvicente at 2023-04-03T12:11:47Z |
Modules
- Mazelib
- Mazelib.Generate
- Mazelib.Solve
Downloads
- mazelib-0.1.0.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
Package maintainers
For package maintainers and hackage trustees