Skip to content

Comment on Generating Mazes

Comments

I don't understand. The article is about maze generation and it only talks about traversing predefined mazes. I had a similar thought after reading an article about generating sudokus. Like they were alreadt generated and the article was about creating a solver. I am surely missing something, what's the part I don't understand?

Ok, after rereading I think I'm starting to understand. The walls of the cells are generated after, based on the path the generator went through? I feel stupid for not understanding this later but will leave this in case I still don't understand something

Yeah, it's confusing. The standard maze generation algorithms start with a fully-blocked grid where each cell has four walls, then proceed to punch holes through one wall at a time. This is basically the same procedure as solving a maze, except when solving a maze you only move between cells that already have holes punched between them. So a solver is really a generator run backwards.

Think of it as an automaton: it can both accept and generate a string. The string here is the path through the maze.

But I think the main, shall we say, contribution of the article is the method they use to find the farthest two points on a maze, that they then set as the entry and exit point of the maze. It's at the end of the article, after the discussion of their preferred method to generate a maze.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.