Programming Diversions Puzzle

by Jason Menard

This month's puzzle is courtesy of Jim Yingst.

Maze Solver

Given an input ascii representation of a maze, write a program to find and display a path from the start point of the maze to the end point of the maze. The output should be a textual representation of the path through the maze from start to finish. It is suggested to use a series of '.' (period) symbols to indicate the path through the maze. You may discuss this puzzle and post your solutions in the Programming Diversions forum.

Notes:

Legend
O Start
X Finish
+ Wall

Maze #1

+++++++++++++++
+   +   +   + +
+ + + +   +   +
+ +++ +++++ + +
O     +   +++ X
+++ +++++   +++
+ +     +++ + +
+   + +       +
+++++++++++++++

Maze #2

+++++++++++++++++++++++++
+         +             +
+ +++++++ + + +++++++++ +
+       +   +   +     + +
+ +++++ +++ + +++ +++ + +
+   + + +   + +   +   + +
+++ + + + + +++ +++ + + +
+   +O  + +   + +X  +   +
+ +++++ + + +++++ +++++++
+     +   +   +   +     +
+++++ + +++ + + + + +++ +
+   +   +   + + +   +   +
+ +++ + +++++ + +++++ +++
+     +   +             +
+++++++++++++++++++++++++