14
the use of a LOGO turtle interpreter as the best-suited visualization mechanism for L-
systems (Prusinkiewicz, 1979).
The meta-language of “turtle graphics,” developed at MIT by artificial
intelligence pioneer Seymour Papert and initially implemented in LOGO (Minsky and
Papert, 1969), interprets single symbols as instructions for a virtual drawing implement,
called a turtle. The metaphor of the language is that a virtual “turtle” exists in a two- or
three-dimensional space, and can secrete ink from its tail to create a persistent image.
The original instructions for the LOGO interpreter were adapted by Prusinkiewicz to be
represented by single symbols generated by an L-system.
The initial instruction set for the turtle consisted of four reserved symbols, which
were to be generated by L-systems to create visual patterns:
F Move forward a discrete amount, drawing a straight line from the turtle’s
previous location.
f Move forward a discrete amount without drawing.
+ Turn left a fixed angle, while staying in place (pivot left).
- Turn right a fixed angle, while staying in place (pivot right).
Figure 2.3: Turtle Graphics: simple instruction set, after Prusinkiewicz, 1979
The distance covered by forward motion (d, typically denoted in pixels) and the
size of the angle used in each turn (
d
, defined in angle degrees) were determined at the
initializing stage of the LOGO program. The “handedness” of turtle interpreters (i.e.
whether + means turn left or right) differs among turtle implementations, and is often
user-defined.
For example, to draw a square thirty pixels on a side, we would initialize our
turtle to [d = 30, d = 90] and feed it the instructions F+F+F+F (draw, turn left, draw, turn
left, draw, turn left, draw).