Posted 27 February 2013 - 03:18 AM
Title: At what point is the turtle pos updated?
The scenario I am thinking about is when the current running coroutine is a turtle code that is about to call a movement function. When the coroutine yields no other coroutines will get execution ( as I understand it ). Is the position and direction of the turtle modified when the turtle code gets execution again or before? I would assume that the movement would never take place if the last running coroutine calls the movement function that will yield until the movement is completed. But assumptions can make bad bugs. At what point during code execution is the turtle location and directions actually updated?
The scenario I am thinking about is when the current running coroutine is a turtle code that is about to call a movement function. When the coroutine yields no other coroutines will get execution ( as I understand it ). Is the position and direction of the turtle modified when the turtle code gets execution again or before? I would assume that the movement would never take place if the last running coroutine calls the movement function that will yield until the movement is completed. But assumptions can make bad bugs. At what point during code execution is the turtle location and directions actually updated?