Mazer
Mazer draws a maze that you can print out and solve. There’s a link to the solution on the page if you get stuck. There’s also a permalink if you want to come back to it later.
Mazer is really an exercize in learning Rust. Rust is so focused on making sure you only build well-behaved, directed-acyclic-graphs that it’s not at all obvious how you would go about modeling some system that is not a DAG.
The Mazer algorithm begins by creating a graph of cells that are connected by edges to every other cell. So lots of cycles, and no edge is initially directed. It then walks the graph, closing some edges and marking others with a direction until the graph becomes a DAG. From there, the solution to finding the path from any point to any other point is to follow the graph from that point to the root, toggling a marker on each edge you cross, and then do the same from the other point. Some edges might be turned on, and then off again if the paths overlap. The resulting edges that are left on show the single path from one point to the other.
It’s not very elegant, and I’ve started re-writing it.
You can specify the dimensions with URL parameters: