The questions are:
Do you have a function that could be used there or do you need to make a function for this or do you even need a function?
If you already have a direction how do you want to deal with it?
Any way you go with this it will be more than just one line. It could be a series of if/else if statements. Or use a return value of a function with either if/else if statements or a switch.
Just seeing the for loop here I can not tell what you have to work with. Line 3 may work better in a function so that the function returns the correct direction of movement.
As your comment says
PUT PROPER DIRECTION FUNCTION HERE ON THIS LINE. So ask yourself the questions what will this function do and what might it return. Followed by how would I use this?
I wish I could do more right now, but like any program need more input.
Hope that helps,
I have a function for each movement command, because I am required to use functions in this program. In the functions for the movement commands, the proper code for making the turtle move is there. Basically what I am asking is if I can somehow pass a function directly onto that line where I have my comment. Like if the direction the turtle is facing is east, then the program sends the move east function to that line, if it is north then the program sends the move north function onto that line, and so on. I will do what you have suggested to work through the problem further. Thank you for your help.
You either have a single move function and pass the direction to that function. Or you could use a switch to call the correct function based on the direction.
With out seeing the move function or more of the program it is only a guess right now.
On the other hand there is no way to write code for a line one the program has started. Hence the switch or if/else statements.
Hope that helps,