2 Value Turtles
The value turtles are a variation on traditional turtles. Rather than
having just a single window where each operation changes the state of
that window, in the graphics/value-turtles library, the
entire turtles window is treated as a value. This means that each of
the primitive operations accepts, in addition to the usual arguments,
a turtles-window value; instead of returning nothing, each returns a
turtles-window value.
Creates a new turtles window with the given width and
height. The remaining arguments specify position of the
initial turtle and the direction in radians (where 0 is to
the right).
Determines if v is a turtles drawing.
Moves the turtle n pixels, returning a new turtles window.
Moves the turtle n pixels and draws a line along the path,
returning a new turtles window.
Moves the turtle n pixels and erases a line along the path,
returning a new turtles window.
Like
move,
draw, and
erase, but using a
horizontal and vertical offset from the turtle’s current position.
Turns the turtle theta degrees counter-clockwise, returning a
new turtles window.
Turns the turtle theta radians counter-clockwise, returning a
new turtles window.
Instead, the merge accepts two turtles windows and combines
the state of the two turtles windows into a single window. The new
window contains all of the turtles of the previous two windows, but
only the line drawings of the first turtles argument.
Produces a turtles like turtles, but with only a single
turtle, positioned in the center.
2.1 Examples
The graphics/turtle-examples library’s source is meant
to be read, but it also exports the following examples.
Places 2n turtles spaced evenly pointing radially outward.
Places 2n turtles evenly spaced in a line and pointing in the
same direction as the original turtle.
As the name says...
Draws a regular poly centered at the turtle with sides sides
and with radius radius.
Draws n regular polys each with n sides centered at
the turtle.
Draws some spokes, using radial-turtles and
spaced-turtles.
Draws a spyro-grya reminiscent shape.