Okay, I'm making a program that will let you traverse a maze where the beginning is the top right corner (coming from the right) and it ends in the bottom left corner (going to the right). We have a 2D array for the board and are using a stack to keep the values entered so that if they hit a dead end, they can back track to where they messed up and try another path.
Now, I'm obsessive of making my program look good, so I decided to make it so that it looks at the previous input and the recent output, and then uses that to to tell what symbol should be inputted (like if you came from the left to right, it prints out a straight line, if from up to right, it does a sort of corner that shows how it goes down then turns right).
Would it be better to have two pointers (one pointing to top and the other to the previous response) or would it be better to handle this some other way?
Second, the first value, no matter what it is, the previous value should be 'R' cause it starts from the right. How would I initiate it so that R is the previous value even though it shouldn't be within the stack?
If anything isn't clear, tell me and I'll try to figure out another way to phrase it. I'm just a little sleepy at the moment to really put it into major details.