Code Snippet Generate a 2D Maze Recursively
This code generates an ascii maze of up to size 30x30. If you try to generate a larger maze then you will likely run out of stack space. There is no way to increase the size of the stack in vbscript. Each cell in the maze is represented by a string of five characters such as "11110". The first four chars represent whether a wall is present ("1") or absent ("0") in the four directions "UDLR". The fifth char represents whether a cell has been visited ("1") or not ("0"). Each cell maintains its awareness of the four walls bounding …
|+0 forum 2|
Code Snippet Right Hand Rule Maze Solver
Demonstrates the Right Hand Rule maze solving algorithm, with some sweet console colors and text display and erasing, in Windows. Note that if the Start is moved away from all the walls in the maze, the right hand rule fails, circling endlessly. Also, a similar failure happens if the Start is put onto an "island" part of the walls in the maze. This algorithm will not solve all mazes.
|+0 forum 0|