From a programming perspective, a maze script is an exercise in or Prim’s Algorithm . It starts with a solid grid and systematically "carves" paths.
Whether it’s a clever bit of math creating a puzzle or a "mod" used to break a game’s rules, a Maze Script is ultimately about control —defining exactly where a user can go and how they get there.
The script picks a starting cell, moves to a random neighbor, and breaks the wall between them. It keeps track of where it’s been (the "stack").