diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-24 21:14:14 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-24 21:14:14 +0200 |
commit | da669db4f083194bc78358041c5d9929e103ac9f (patch) | |
tree | 3b1b27cac655cb7f852ff4d13233bc278f12ff0f /BreadthFirstPathfinder.cpp | |
parent | dabfb8188aab86ea8d8c9794ee8e46f6e22291f4 (diff) |
add more todos, shortcut keys and logging
Diffstat (limited to 'BreadthFirstPathfinder.cpp')
-rw-r--r-- | BreadthFirstPathfinder.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/BreadthFirstPathfinder.cpp b/BreadthFirstPathfinder.cpp index c204387..e3a5430 100644 --- a/BreadthFirstPathfinder.cpp +++ b/BreadthFirstPathfinder.cpp @@ -18,9 +18,12 @@ void BreadthFirstPathfinder::find_between(const XY & start, const XY & end) { vector<Path> trails = { { start } }; this->end = end; + int steps = -1; while (trails.size() > 0) { + steps++; trails = this->find_step(trails); } + printf("BFS: %s (%d steps)\n", this->solution.empty() ? "no solution found" : "solution found", steps); } vector<BreadthFirstPathfinder::Path> BreadthFirstPathfinder::find_step(const vector<Path> & to_visit) { |