5 ms·
This code displays forward slash and backslash randomly over the entire screen. This may look a bit like a maze, but it is not. Title should read "How to displa
by rilita 12y ago
This code displays forward slash and backslash randomly over the entire screen. This may look a bit like a maze, but it is not. Title should read "How to display random garbage to the screen as slashes in 13 bytes". Still impressed?
- lkbm 12y agoWhat constitutes a maze? Enforced solvability?
- tromp 12y agoForming a spanning tree; or equivalently, having a unique path between any two cells. Sometimes a few additional connections (adding cycles to the spanning tree) are considered ok.
- theoh 12y agoReally, multiply connected mazes are more interesting and more aesthetically pleasing. A question, though. If, in 2D, having all walls in one piece is simply connected, and having some islands is multiply connected, what are the possible types of 3D maze (let's call it a cave). You can obviously have simply connected walls, or multiply connected walls (floating shells of rock) but what name would you give the type that has some looping paths but no floating rocks? Do we talk about genus?
- bufordsharkley 12y agoMike Bostock's visualizations of maze-creation algorithms (via spanning tree) are absolutely beautiful: http://bost.ocks.org/mike/algorithms/#maze-generation http://bost.ocks.org/mike/algorithms/#maze-generation
- CamperBob2 12y agoYou were modded down, but I tend to agree. Randomly printing slash characters is not a valid way to generate anything that could be called a "maze," and it's consequently not a very interesting thing to optimize. I suppose that if you fed it with a source of true randomness and let it run long enough, the output would eventually contain all possible mazes with unit corridor width. It may be more precise to say it can't generate a labyrinth, or a dungeon with rooms.