Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Maze code snippet to solves a maze, for example the mazes created by CreateMaze/CreateSloppyMaze. Relies heavily on the algorithms GetMazeDistances and GetDistancesPath. Note that the code below is not an efficient algorithm: the std::vector created by GetMazeDistances remains the same, as long as the maze remains the same. When the maze does remain the same, I'd suggest to calculate the maze distances once and store it, from then on calling GetDistancesPath only.
#include <cassert> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.