r/ComputerCraft • u/smallcluster • Jun 04 '25
Made a computercraft focussed lua library for generating mazes
This is a small lua library buit around a consumer-producer pattern, where a maze is represented as a grid of state (usually wall or empty).
Why ? Because I like maze stuff :) and wanted to have fun with lua.
A maze act as a consumer on state update (changes in the grid) provided by the chosen generator. With the use of a filter, each step can be intercepted and displayed on the screen before forwarding it to the maze.
For now there are 3 generators : Kruskal, Recursive-backtracking and origin shift
Code and library here : https://github.com/smallcluster/ccmaze
10
u/Hidden1nin Jun 04 '25
Pretty incredible! Thats awesome.
4
u/Etanimretxe Jun 04 '25
I have been working on a 2d turn based game engine, I should try hooking this in for players to solve.
4
u/JackrTades Jun 05 '25
I wonder if you could incorporate Create/redstone and have walls pop up in order of the display
3
u/PandaWithin Jun 04 '25
There’s also another way of making mazes where you divide the grid non uniform halves, add a “passageway” in the line and continue in one of the newly created grid, continue recursively until completion
6
u/[deleted] Jun 04 '25
[removed] — view removed comment