Dec 2022: I realized that I have encoded the GIF data incorrectly, with 3 Bytes per pixel rather than one. No idea how it works still.
maze generator with optional gif creation
stuff to tweak is at the top of the helper file
GIF
-
The pink represents the head. It visits unvisited cells until it reaches a dead end.
-
The shades of red represent a backtrack. This happens when a dead end is reached. The head will backtrack until it reaches a cell with unvisited neighbors. Once all cells are visited, the head will backtrack to the beginning cell, indicating completion.
-
The end of the gif shows a completed maze with the exits marked with light blue.
-
Blocky and jagged hall style choices
The maze size is greatly limited if creating a gif. I can do 80x80 on my PC.
If gif creation is off, the maze can be much larger. I got up to 4000x4000 on my PC.
The bottleneck in both cases is primarily the amount RAM. Thrashing slows the program to a crawl. However, gif creation for "smaller" mazes (<100) is mainly CPU bound.



