Академический Документы
Профессиональный Документы
Культура Документы
5
I
Chapter 13
Circles
The turtle can make curved as well as straight line designs. Curves are made by repeatedly taking a small step and then turning just a little bit. To make a complete circle the turtle has to turn 360 degrees. Try this:
REPEAT 360 [FD 1 RT 1]
5
; i
R E P E A T 360 [FD 1 RT 1]
If you want to vary the size of the circle, use the command c i r c l e r (pronounced circle-are) or c i r c l e l (pronounced circle-ell) with an input for the size of the circle. The input is a number which is the radius, i.e., the distance from the edge of the circle to its center. Try
20 10 20 10
c ir c l e r
causes the turtle to draw a circle by turn ing right and c i r c l e l causes the turtle to draw a circle by turning left.
Bug Box If Logo does not know how to c i r c l e r or c i r c l e l skip this chapter. Appendix A offers an explanation of why Logo might not know how to do these procedures.
91
BALLOON
L O L L IPO P
FLOW ER
0
LEYE
TO REYE CI RCLER 2 0 CI RCLER 1 0 END TO LEYE CI RCLEL 2 0 CI RCLEL 1 0 END TO BALLOON FD 4 0 C I R C L E R 10 END TO LOLLI POP FD 4 0 LT 9 0 C I R C L E R 10 END
TO F L OWE R FD 2 0 CIRCLER 5 LOLLIPOP END
92
fac e
with an input. It
h e a d , e y e s , m o u th
93
Another one i s
TO B U L L S E Y E HE AD 1 0 HEAD 2 0 HEAD 3 0 HE AD 4 0 END
b u lls e y e :
BULLSEY E