Solve a Maze With Google Blockly
Blockly is a web-based, graphical programming language. To write a program you assemble puzzle pieces, each representing a different component. It’s fun too ;)
One of the demos is a maze. Your job is to assemble the puzzle pieces in such a way as to get peg man to the end.
Once your blocks are in place, hit the Run Program button to let’er rip. If you don’t solve it on the first (or tenth) try, you’re in good company.
You can obviously do something simple like this, but it’s not nearly as fun as creating an algorithm that would work for other mazes.
It took me a while to come up with an algorithm I was pleased with. Try it on your own first to get a feel for it, but if you get stuck, here’s one solution.
http://imgur.com/TxiJ8
solves it with 11 “blocks” (I think!)
@Tony Cool. Why do you only think it solves it? Didn’t you run it to make sure?
Here’s another slightly better solution: http://viralpatel.net/blogs/google-blockly-solved/
If not wall to left turn left
If wall ahead turn right
If not wall ahead go forward