I am trying to move a player down a linked list after they've made their choice of going left or right after storing the data in the .data portion(as dictated by a called txt file containing these values)
I've so far figured out how to store the data seperatly in a stack, but then cannot for the life of me how to then move the player on to the next item
Heres what I have so far(not started on the right choice yet, as its literally going to be the opposite of left):
class node
{
public:
int left;
char data;
int right;
};
node *start_ptr = NULL;
node *current_ptr;
Explain left and right to me. What do they represent? What is start_ptr and current_ptr and why are they never used?
In play where are row and column ever assigned values? What are Left and Right and why are they never assigned values? What is stacklist and why is it never assigned value(s)? Why do you have two variables in the same scope named tos? What is moves and why is it never assigned a value? What is stackobject1 and why is it never used?
In main what is the variable tos and why is it never used? Why are you looping on option != '5' when 'q' is the quit condition? main must return type int.
So Left and Right are to signify the players next move (for example, if the txt file reads "46 3 35" then the player must go either left or right, to either Left, which would be - row 4, col 6 or Right, which is - Row 3, col 5 and then store the Letter E in a separate stack)
start_ptr and current_ptr are currently not being used, but are there for later implementation (I meant to comment them out)
Stacklist is my stack, and I'm trying to store the letters from each move in there (to a maximum of 20 moves) tos is short for Top of Stack, there reason why there is 2 values assigned is that I'm not sure where to place it right now
Moves is a count of how many moves a player has made (they lose if it hits 20)
the last point is a typo, fixed now, thanks for helping.