A simple random maze generator
bundle install
bundle exec rackup
Now you can visit the web interface at http://127.0.0.1:9292.
Use this command to run the test suite:
bundle exec rspec
/maze/random generates a radom maze
$ curl http://localhost:9292/maze/random
<pre>
+---+---+---+---+---+---+---+---+---+---+
| S | | |
+ + +---+ +---+ + + + +---+
| | | | | | | |
+---+---+ + +---+ +---+---+ + +
| | | |
+ + + + +---+---+---+---+---+---+
| | | | | |
+---+ +---+---+ +---+ +---+---+---+
| | | |
+ +---+---+---+ +---+---+---+---+ +
| | | |
+ +---+ +---+---+---+ +---+---+---+
| | | | |
+---+ +---+ +---+---+ +---+---+ +
| | | | | | | |
+ + + +---+ + +---+ +---+---+
| | | | | | |
+---+ + + + + + +---+---+ +
| | E |
+---+---+---+---+---+---+---+---+---+---+
</pre>
Request params:
sizeDefaults to 10, will set the resolution of the maze eg/maze/random?size=6will produce a 36 rooms maze.solutionDefaults to false,/maze/random?solution=truewill show the path to solve the maze.