Problem Description Find the largest and smallest paths through the number grid as you move from 'S' to 'F'. Paths can move straight or diagonally to the right but never to the left. I believe this is our first excursion into graph searching here - but not our last. I know of no way to solve this problem without examining all paths and selecting those with the largest and smallest sums. Grids up to 13 by 13 are supported and solved in about a second.
Mazes are graphs - each box is a vertex and the openings for next moves are edges.
Recursive calls to procedure GetPath are made, each call checking the vertices that are up and right, straight across right and down and right - the three possible paths from any vertex. A Stringgrid is used to display results. An option is provided using Stringrid's OnDrawCell event exit to animate the searching algorithm so you can watch the paths as they are tested. The board is a doubly dimensioned dynamic array of integers. If there is anything else unclear, send me an email.