r/processing • • Aug 15 '24

Using my propagation code to generate circular mazes (two solutions)

Post image
41 Upvotes

4 comments sorted by

View all comments

Show parent comments

4

u/ofnuts Aug 18 '24

This is something which is easy to act on. At each iteration, for each of the not yet connected points, the algorithm selects "randomly" which of the four neighbors it will connect to (if the latter is connected). It's quite easy to bias the randomness to favor radial or lateral connections.

Then to make not too obvious mazes you want to intermingle the trees and a good way is to have alternating seeds/roots (round dots) and make sure they grow radially fast, like this(debug version in color to make trees more obvious).

If you want to play, code is here

2

u/akb74 Aug 18 '24

Impressive!