Just click the flag and watch the program generate a 3x3 maze! Yeah... it's lame, but I'm proud of it XP The top left is the start, and the bottom right is the finish, but you can get from any square to any other square, so what's the difference? Press up to increase time between trials, down to decrease it, s to show it, h to hide it, and r to reset it. The conditions of a valid maze are: 1. Any square can be reached from any other square. 2. There are 4 barriers. That's it! This guarantees exactly one solution. You can try to figure out the maze if you want, but it is very easy.
First, this program randomly activates 4 barriers. This program then uses a simple depth-first search to see which squares can be reached. If all of the squares can be reached, it is a valid maze. If it is an invalid maze, the program clears the board, resets the data, and randomly activates 4 more barriers. This project has extra blocks because I meant it to represent all sizes or as a general example in a specific case. This makes it easier to understand and generalize. 5/11/18 This project was made and proof-checked.