The main function is ReadAndEval, which gets a message and then interprets its and act upon the result. In addition to a pointer to its current board, and to inner-state variable which affects its graphical aspects, every turtle holds an expandable array of interrupts. The turtle's location are stored as floating points on x,y axes, to allow for accuracy on the turtle's location and heading. The turtles interacts with the interpreter thread using a message queue. As with the board, the main function here is the ReadAndEval, which translates these messages to valid function calls.
Every turtle holds a pointer to the bitmap it is drawing on.
Then it iterates on all the pixels in this rectangle. First it checks if the pixel is in the vision area using the sign rule to determine if a point is clockwise or anti clockwise from a line, and then check for distance. If the point is in the relevant area the turtle gets its color from the bitmap and compares it with the sought color. When looking for a specific turtle, the turtle gets this turtle's position and calculates if this location is in the relevant area using the same algorithm. When looking for any turtle, the turtle passes the relevant arguments to the view, which then uses the same algorithm for each turtle on its turtles array.