From da669db4f083194bc78358041c5d9929e103ac9f Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 24 Oct 2024 21:14:14 +0200 Subject: add more todos, shortcut keys and logging --- BreadthFirstPathfinder.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'BreadthFirstPathfinder.cpp') 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 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::find_step(const vector & to_visit) { -- cgit v1.2.3