Turtles

3.1  Turtles

There are two ways to use the turtles in DrScheme. You can use it as a TeachPack (see the DrScheme manual for details of TeachPacks) or as a library. Use the turtles.ss TeachPack.

In the MrEd language or in a module, load turtles with

(require (lib "turtles.ss" "graphics"))

The following are the turtle functions:

Turtles also defines these syntactic forms:

In the file turtle-examples.ss in the graphics library of your PLT distribution, you will find these functions and values defined, as example turtle programs. (The file is located in the graphics subdirectory of the collects subdirectory of the PLT distribution).

3.2  Value Turtles

There are two ways to use the turtles in DrScheme. You can use it as a TeachPack (see the DrScheme manual for details of TeachPacks) or as a library. Use the value-turtles.ss TeachPack.

In the MrEd language or in a module, load turtles with

(require (lib "value-turtles.ss" "graphics"))

The value turtles are a variation on the turtles library. Rather than having just a single window where each operation changes the state of that window, in this 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 and instead of returning nothing, returns a turtles window value.

The following are the value turtle functions:

In the file value-turtles-examples.ss in the graphics library of your PLT distribution, you will find these functions and values defined, as example turtle programs. (The file is located in the graphics subdirectory of the collects subdirectory of the PLT distribution).

It contains a sampling of the examples from the normal turtles implementation, but translated to use merge and the values turtles.