One of the easiest path finding routine is the so called depth-search algorithm. It's not very fast, but it works very well.

In theory this is how it works: imagine you are in a labyrinth and have a piece of crayon that you can use to make markings on the wallks. While walking, always mark the walls with a straight line. Now if you reach a crossing, choose the path that has the least markings or if it has no markings, choose the one to the right (or left, makes no difference).

This can easily be implemented in delphi. If you have an array, simply have an Integer for every array field that you increment in your pathfinding routine.


A* is of course much faster, but also slightly harder to understand.