anyonecan build a robot that draws. (In most cases, the unpredictability of the physical world means that drawings with physical turtles have an interesting imperfection as compared to those from their digital counterparts.)
(turtle-new
image-id ), which creates a new turtle
associated with a particular image. You will, of course, need to name
that turtle. For instance, if you've already created an image called
canvas, you could create a turtle on that image.
(turtle-clone
turtle ). The clone is associated
with the same image and has the same position and orientation as
the original turtle. Once again, when you create a new turtle with
(turtle-forward! turtle amt )
advances the turtle the specified amount, drawing if the pen is down.
(turtle-turn! turtle degrees )
turns the turtle clockwise the specified number of degrees.
(turtle-up! turtle )
lifts the turtle's pen.
(turtle-down!
turtle )
drops the turtle's pen.
hacksthat let you place and orient the turtle precisely.
(turtle-teleport! turtle column row )
moves the turtle to a particular column and row.
(turtle-face! turtle degrees )
makes the turtle face a direction the specified number of degrees
clockwise from right.
|
|
(turtle-reset! tommy)
|
|
|
(turtle-reset! tommy)
|
|
|
(turtle-reset! tommy) (turtle-forward! tommy 25)
|
|
|
(turtle-reset! tommy) (turtle-turn! tommy -135)
|
|
|
(turtle-reset! tommy) (turtle-turn! tommy 90)
|
|
|
(turtle-reset! tommy) (action01! tommy)
|
|
|
(turtle-reset! tommy) (action02! tommy)
|
statesof the turtle and different images. To some, the result of
|
|
(turtle-reset! tommy) (action01! tommy) (action 01! tommy)
|
|
|
(turtle-reset! tommy) (action02! tommy) (action 02! tommy)
|
|
|
(turtle-reset! tommy) (action01! tommy) (action 01! tommy) (action 01! tommy)
|
(turtle-set-color! turtle color )
sets the color of the brush the turtle uses.
(turtle-set-brush! turtle brush )
sets the brush the turtle uses.
(repeat! n proc! value ) procedure,
which repeatedly |
|
(action03! tommy)
|
|
|
(repeat! 2 action03! tommy)
|
|
|
(repeat! 3 action03! tommy)
|
|
|
(repeat! 4 action03! tommy)
|
|
|
(repeat! 20 action05! tommy)
|
|
|
(repeat! 36 action05! tommy)
|