Вы находитесь на странице: 1из 6

( P

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

CIRCLER CIRCLER CIRCLEL CIRCLEL

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

Projects Using Circles Here are some projects using circles.

EYES TO EYES REYE LEYE END


REYE

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

In this example we define uses several procedures: and n o s e .


TO F A C E : S I Z E HEAD : S I Z E EYES : S I Z E / 5 MOUTH : S I Z E / 5 NOS E : S I Z E / 5 END TO HEAD : S I Z E PU FD : S I Z E RT 9 0 PD C I R C L E R : S I Z E PU LT 9 0 BK : S I Z E PD END TO E Y E S : S I Z E LEYE : S IZ E REYE : S I Z E END TO L E Y E : S PU LT 9 0 FD : S PD CIR CL ER :S / 2 PU BK : S RT 9 0 PD END TO R E Y E : S PU RT 9 0 FD : S PD CIRCLEL : S / 2 PU BK : S LT 9 0 PD END TO MOUTH : S I Z E PU BK 2 * : S I Z E RT 9 0 FD : S I Z E / 2 PD BK : S I Z E PU FD : S I Z E / 2 LT 9 0 FD 2 * : S I Z E END TO NOS E BK : S END :S

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

Вам также может понравиться