Permalink
Browse files

updated readme

  • Loading branch information...
1 parent 47bfaab commit ebb1d1251281cc3563e7f60d2176a1e77ff5d150 @liweinan committed Mar 24, 2013
Showing with 38 additions and 2 deletions.
  1. +37 −0 README.md
  2. +1 −2 src/main/java/io/maze/PlayMaze.java
View
@@ -51,6 +51,43 @@ From the log you can see how the maze is generated:
| V |
+---+---+ +
+Now you can try to use PathFinder to solve the maze:
+
+ PathFinder finder = new DefaultPathFinder();
+ finder.solve(maze);
+
+And print it:
+
+ maze.print();
+
+Now let's have some fun:
+
+ Maze maze = MazeFactory.createMaze(16, 9);
+ PathFinder finder = new DefaultPathFinder();
+ finder.solve(maze);
+ maze.print();
+
+ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+ > | * * * * * * * | |
+ + +---+ +---+---+---+---+---+ +---+ +---+ +---+---+ +
+ | * * * | | | * * | | | |
+ +---+---+---+ +---+ + +---+---+ +---+ +---+ +---+---+
+ | | | * * | | * * | * * | | |
+ + + + + + +---+---+ + +---+ + +---+---+---+---+
+ | | | * | * * * * | * | * | | |
+ + +---+---+ +---+---+---+---+ +---+ + + +---+---+ +
+ | * * * * | | * * * | | | |
+ + +---+---+---+---+---+---+ +---+---+---+ +---+ + +---+
+ | * | * * * * * * | * * | | |
+ + + +---+---+---+---+ +---+ + +---+---+---+---+---+ +
+ | * | * * | | * * * | * | * * * * * * |
+ + +---+ + + +---+---+---+---+ + +---+---+---+---+ +
+ | * * * | | | * | * | | * * |
+ +---+---+---+ +---+---+---+ +---+ + + + +---+ +---+
+ | | * * | | * V |
+ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ +
+
+
## Reference
* [Practical algorithms and code optimization: maze generation ](http://ilay.org/yann/articles/maze/index.en.html)
@@ -15,8 +15,7 @@
public class PlayMaze {
public static final void main(String[] args) {
- Maze maze = MazeFactory.createMaze(30, 30);
- maze.print();
+ Maze maze = MazeFactory.createMaze(16, 9);
PathFinder finder = new DefaultPathFinder();
finder.solve(maze);
maze.print();

0 comments on commit ebb1d12

Please sign in to comment.