Maze recursion function

I can't post code on here I've been informed by my instructor. So I have to try and explain what I need to do. I have a recursive function, it acts on a class that has 4 direction pointers. There is a 2D grid of these class objects read in from a file. There is a starting position, and an ending position. There could be multiple paths, dead ends, or even a loop. My recursive function does something like this:

Take in a vector, and a class pointer node.

push back node

if not equal to end value do this:

check all optional paths in current class object, if none, back up

if open path, call function on the node this path leads to N, E, S, W.

It works perfectly if it's a straight path, with no dead ends, or loops, or alternate paths. If there is a dead in, it displays that it went into that dead end, when it shouldn't.

If there is a loop it will shut down, same with multiple paths, which constitute a loop.

If you are calling a recursive function, and you come to a dead end, how can you get it to back up without showing we tried that path?

I'm sorry I can't provide more details, I'm told I can't post code, but my instructors aren't emailing me back and this thing is due tomorrow. Should I use a stack instead of a vector? If so, how do I implement a stack?

Thanks!!!!
Do your own homework.
I did my own homework thank you, always have, I'm not some kid asking for a freeby. I'm stuck on one part of figuring this out, that's what this forum is for... and apparently for assholes to talk smack behind the safety of their keyboards.
Topic archived. No new replies allowed.