6.3.90.900
2 Commands for Racket Turtle
Moves the turtle forward x pixels, if given x is positive,
backwards it it’s negative.
Turns the turtle heading to the left
a degrees, if given
a is positive.
Negative
a will make the turtle to turn right
(abs a) degrees.
Turn the turtle heading to the right
a degrees, if given
a is positive.
Negative
a will make the turtle to turn left
(abs a) degrees.
Makes the turtle to repeat k times the commands given in the command-list.
Lifts up the pen so the turtle will not draw a line when it moves. The default position is down.
Puts the pen down so that the turtle will draw a line as it moves.
Makes the turtle go to a given point (
x,
y). The origin of the turtle image is in the low left
corner unless it has been moved (see:
set-origin).
Makes the turtle go to the origin of the animation window. The origin is in the low left corner unless it
has been moved (see:
set-origin).
Changes the color of the pen (the default color is blue). The argument can be a single color or a
color-list, which contains one or more colors. Colors in the color-list are used one by one
and when the list is finished it starts from the beginning.
Sets the width of the pen. The width is an interger between 0 - 255.
Note! WeScheme doesn’t support this.
Changes the pen style. The style can be one of these: "solid", "dot", "long-dash",
"short-dash" or "dot-dash".
Note! WeScheme doesn’t support this.
Changes the background color (the default color is white). This command should be used first since it
fills the whole image with the given color.
Sets the given image img as a background image. This command should be used before drawing the actual image,
since img is put on top of the existing turtle drawings.
Draws a background grid with given cell width, height and color. This command
should be used before drawing the actual turtle drawings.
Stores the current position of the turtle as a new origin. The location of the origin is shown as a red dot during
the turtle animation.
Activates the stamper. Stamper draws one stamp in each new turtle location. If the argument is a list of
images stamp-list stamps are used one after another according to the list. After all stamp images have been
used once, the list starts again from the beginning.
The stamper doesn’t affect the pen so if the pen is down, a line will be drawn in additions to the stamps.
Removes the stamper.
Copies the turtle commands so that they are mirrored horizontally e.g. there will be a second
mirrored image in addition to the original image. The position of the mirroring axis is set to be a vertical line,
which y-coordinate is taken from the point in which
mirror-x-on was used. If
mirror-y-on is
used in the same location, the mirroring will be done also vertically.
Copies the turtle commands so that they are mirrored vertically e.g. there will be a second
mirrored image in addition to the original image. The position of the mirroring axis is set to be a horizontal line,
which x-coordinate is taken from the point in which
mirror-y-on was used. If
mirror-x-on is
used in the same location, the mirroring will be done also horizontally.
Removes horizontal mirroring.
Removes vertical mirroring.
Cleans up the animation screen including the background image and grid but keeps the background color.
Also the location and heading of the turtle are kept.
Hides the turtle sprite for the duration of the animation (turtle is visible as a default). Turtle sprite is a black
triangle showing the location and current heading of the turtle.
Shows turtle sprite again during the animation. Turtle sprite is a black
triangle showing the location and current heading of the turtle.