Killing a stack

Started by
10 comments, last by geek89turbo 18 years, 5 months ago
I would do the recursion for this problem like this:

Check left, if returns 'exit found', return 'exit found'
Check right, if returns 'exit found', return 'exit found'
Check forward, if returns 'exit found', return 'exit found'
return 'exit not found'

this assumes that one of the arguments of the function is 'where I came from' and the 'left', 'right' and 'forward' are calculated relatively to it.
thanx for sharing
Advertisement
Cool this gives me some ideas to play with, I was wondering if I needed to set up a specific value to return when the exit is found. Setting up something to track where the computer has been so that it won't go back sounds like a good idea.

Anyway thanks for the help everyone!

-Brandon

This topic is closed to new replies.

Advertisement