Hi everybody.

I made a snakelike game in DDraw. Now I want to implement CPU enemys. So I'm thinking about a pathfinding method. I think I use A. (I'm not sure if that what I planned to do is excatly A)

Now I have no real Idea how to implement it into Code
I have an Idea, but in this Idea I'd need to start the same Sub very often, so I'll run out of stackspace!

(pseudo)code:
sub explore(x as long, y as long)
(now check out all for possible directions than give a movemtcost to them in a two dimensional array than if one of the four directions is okay call sub explore again)
end sub

I hope you understand me.
So If you can help me with an idea how to do a goodpathfinding write me!!!

Thank you