-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package up maze generation impls (and Ariadne's zipper?) into a project (Chapter 3) #7
Comments
Not sure if this is the appropriate place or not, but I was creating a project based on the Ariadne zipper. I ran into one issue that you might want to consider. Sometimes, two points cannot be connected. In this case, the zipper hangs. Is there a way for the zipper to detect this hang situation and return an empty path? |
The Ariadne zipper only works on connected acyclic graphs — and the generated mazes are such graphs. |
I'm not creating my own graph, I'm just trying to use the code from the book. I created a gist here: https://gist.github.com/2715291 I edited the code as little as possible from the text here: If you load a repl via "java -jar clojure-1.3.0.jar", paste in the gist text, then invoke (testit) multiple times, it hangs relatively often for me (1 of 4 times at least). When it hangs, the maze is drawn (via my added first call with empty path), the println for the location of theseus & minotaur is output, but no path is drawn. I assume that the calculation of the path is hanging. |
Good catch: if the minotaur is in a dead-end, its location never appears in the value returned by z/path. It does only affect the version with the filter not the first one which just prints the path. |
@rogerallen fixed here 9ffe8d4 |
@cgrand, maybe you'd like to take care of this?
The text was updated successfully, but these errors were encountered: