| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] | 
Procedures for turtle graphics like LOGO.
For example, the following code paints Koch curve.
(define w (make-window-frame 600 600 -1 -1 21 21))
(define t (make-turtle w 0 0))
(define (koch len times)
  (if (= times 0)
    (turtle-draw t len)
    (begin
      (koch (/ len 3.0) (- times 1))
      (turtle-turn-right t 60)
      (koch (/ len 3.0) (- times 1))
      (turtle-turn-left t 120)
      (koch (/ len 3.0) (- times 1))
      (turtle-turn-right t 60)
      (koch (/ len 3.0) (- times 1)))))
(koch 20 7)
creates a turtle.
frame specifies a frame to draw a turtle,
init-x and init-y specify a initial coordinate of the turtle
and turtle-image specifies an image of the turtle.
The default image is used if turtle-image is not specified.
draws a line whose size is the given length along current direction.
rotates the turtle to left(right).
moves the turtle along current direction without drawing.
changes the color in which the turtle draws.
clears what the turtle has been drawn.
undoes one action which the turtle has been drawn.
hides(shows) the turtle.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | 
 
  This document was generated on August 9, 2012 using texi2html 5.0.