= Turtle graphics
<Turtle graphics> draws through commands interpreted relative to a moving cursor's position and heading. A forward command moves along the current heading, a turn changes it, and pen state determines whether motion leaves a mark. The picture is the trace of a sequence of <state> changes, making geometric reasoning executable.<Berkeley Logo 6.2 User Manual by Brian Harvey>[Graphics, FORWARD, RIGHT, PENUP and PENDOWN]{ref}
In <Logo>, `repeat 4 [forward 100 right 90]` draws a square and returns to the original heading and position. For a regular $n$-sided <polygon>, each exterior turn is $360/n$ degrees, so the total turning is one full revolution. The same procedure works from a different initial position or heading, illustrating how local commands avoid specifying every absolute coordinate.
Back to article page