Maze Path Finding

Let us imagine the Maze as a matrix made up of 0s (empty space) and -1s (walls/obstacles) like so:


var aMatrix = [
    [0,  0, 0,  0, 0],
    [0, -1, -1, -1, 0],
    [0,  0, 0, 0, -1],
    [-1, 0, -1, 0, -1],
    [-1, -1, -1, 0, -1]
];
            

The Lee Algorithm allows us to take an arbitary start and end cell within the matrix and attempt to calculate a viable route through between the two cells. In this case we are starting at 0,1 and aiming to get to 6,6. Try it below!

A little project by James Milner