desple.com/post/118014845597/solving-a-maze-with-perl

Mazes are really famous puzzles where the goal is to find the exit starting from an entrance. We can see these kind of puzzles as a labyrinth. When we found the solution we then draw over them to mark the path that we have to find.

Most of the time these puzzles are generated by computer programs, these computer programs then use algorithms such as depth-first searching to create the mazes. We can however also solve these puzzles by using the same algorithm.

This article will cover the solving of a maze, there will be more efficient methods to solve these mazes but I will just explain one of the many.

Reading in the maze

Reading in the maze can be done in several different file formats. We will use a SVG format here because this lets us draw the solution on top of it easily.

Example of a maze in svg:

<?xml version=


Comments (0)

Sign in to post comments.