Tymless Tutorial: Drawing



   
  < lines

Flipping

 
regular polygons >
 

Drawing

Control

Data

Reference

 

Two useful commands connected with turning are faceabout !, and flip ~.

The faceabout command tells the turtle to turn around and face the direction it came from.

The flip command tells the turtle to swap the meaning of left and right. Using this twice brings the turtle back to 'normal'. It might seem a peculiar request, but is actually very useful in repeated sections of code such as loops and recursion.

In case you lose track, you can tell whether the turtle is flipped by checking the system variable $~ . By setting the value of this to 0 or 1 you can also flip the turtle.

   
  < lines
 
regular polygons >