First forward into Logo 3: repeat REPEAT
More Logo for beginners. Now learn more about the REPEAT command.
Problem
First Forward Into Logo
Previous: FF2
Now that you have seen how easy it is to draw squares triangles, pentagons, hexagon, heptagons etc. let us use these shapes as basic units of a pattern.
Why not repeat what you have already repeated!
Imagine:
Drawing a square (Say, REPEAT 4 [FD 50 RT 90])
Now turn 30 ° left.
Draw another square.
Now turn another 30 °.
Draw another square.
Now turn another 30 °.
Draw another square.
Now turn another 30 ° and so on until you get back to where you started.
Now this is really: REPEAT 12 [REPEAT 4 [ FD 50 RT 90] LT 30] (hint: 12 x 30 is 360)
Image
| Image
| Image
|
Why not experiment with other turns, other sizes, other shapes.....other...?
You might also want to experiment with changing the colour of your pen:
PENCOLOUR (abbreviation PC). You need to tell this primitive how much
[Red Green Blue] to mix to make your pencolour.
Try [255 0 0] - and start drawing. Was it what you expected?
N.B. 255 is the largest amount of any colour you can use.
SHOW PC tells you what pencolour you are using.
Next: FF4