]> Untitled Git - axy/ft/a-maze-ing.git/commitdiff
Extra readme
authorAxy <gilliardmarthey.axel@gmail.com>
Mon, 30 Mar 2026 03:19:15 +0000 (05:19 +0200)
committerAxy <gilliardmarthey.axel@gmail.com>
Mon, 30 Mar 2026 03:19:15 +0000 (05:19 +0200)
README.md

index 891f21e06beabde493caf8b96dae09ebf01f9fc6..f37b16d960f0030dc5a2c896a01c928d70a0831a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -110,6 +110,28 @@ The following fields exist:
 - MAZE\_PATTERN, [pattern](#pattern)([optional](#optional)): Each non-space character in the pattern will be a filled cell in the maze, after centering
 
 
+# Use as a module
+
+This package is suitable for use as a module, use either the complete package and api as in [a\_maze\_ing.py](./a_maze_ing.py), or utilise `mazegen.MazeGenerator` as follows:
+```python
+from mazegen import MazeGenerator
+
+gen = MazeGenerator((10, 10), (0, 0), (9, 9))
+
+# prints in the same format that gets written to file normally
+print(gen.get_output())
+```
+
+# Output format
+
+The output has been specified in the subject, but here is the short spec, in order:
+
+- The maze in hexadecimal format, one line per row of cells, each hex digit corresponds to one bit from LSb to MSb of whether the walls (North, East, South, West) are filled
+- An empty line
+- The entry Coordinate
+- The exit Coordinate
+- The shortest path from entry to exit, as a sequence of letters, (`N`, `S`, `E`, `W`) for (North, South, East, West) respectively
+
 # Algorithms
 
 The used algorithms for generation were not based on any reference algorithms