Some additional words on how this works:

You have an array (in this case "Maze") which represents your playfield. Now each field has an integer value which i like to call "cost". Passable fields have a low cost (in this example, 1) and walls have a very high cost (in my case 4000). You can also handle walls separately if you like. Now from your starting point, you check the surrounding fields to see which one has the lowest "cost" and move to that field. You increment the cost of the previous field basically to mark that you've been there already. The destination field has the cost "0" to make sure the routine is definitely going to choose that field over any other. When you moved to a field with the cost "0" you are at your destination.