Goal: Draw a thick colored square.
Vocabulary: setpensize, repeat

Notes When the turtle draws a square, it does the same thing 4 times. It moves forward and turns exactly the same amount. This project shows how to put identical commands into a "repeat" command.
- The turtle can draw lines that are very thin, very thick, or anywhere in between.
In the square procedure, setpensize 5 tells the turtle to draw thicker lines (5 pixels thick). Every turtle starts out with a pensize of 1. You can choose any pensize up to 100.
- Repeat 4 means, "Do everything inside the brackets, four times." Instead of writing:
fd 100 rt 90
fd 100 rt 90
fd 100 rt 90
fd 100 rt 90
we can write: repeat 4 [fd 100 rt 90]
What If?
Try a different input (number) after setpensize.
Try a different input after fd.
Challenge
Can you make a rectangle using the repeat command?
|