Algorithm to walk through a maze.

HI,

MY problem is to write a recursive function to walk through a maze. There is an algorithm. It's that you start at the right wall and walk forward and keep following the wall. You are guaranteed to find the exit and if there's none you'll come back to the starting point. But i really don't know where to start. The function should receive as arguments a 12-by-12 double-subscripted array representing the maze and the starting location. As it walks through the maze it replaces the path with the character 'X'. The function should display the maze after each move so the use can watch as the maze is solved. I need some help since i really don't know where to start. How to determine its path. Pls direct. Here is a sample maze:

Code:

############

# # #

# # #### #

### # # #

# ### #

#### # # # #

# # # # # #

## # # # # #

# # #

###### ### #

# # #

############

i know it looks a bit strange but i guess you'll figure it out. Thnx in advance!