MSWLogo provides tools to change the color and thickness of the pen the turtle uses to draw. By adjusting the pen's settings, you can create colorful drawings and control how thick or thin the lines are.
The SETCOLOR command in MSWLogo allows you to change the color of the turtle’s pen. You can choose any color available in the color palette.
The syntax for changing the pen color is:
For example, to set the pen color to red, you can use:
In MSWLogo, each color is assigned a number. For instance, color 1 is black, color 2 is red, color 3 is green, and so on. You can refer to the color chart in MSWLogo to know the number corresponding to each color.
You can change the thickness of the turtle’s pen using the SETTHICKNESS command. This will affect how thick or thin the lines are when the turtle draws.
The syntax for changing the pen thickness is:
For example, if you want the pen to draw with a thickness of 3 units, you can use:
Experiment with different thickness values to see how the lines change. A higher value will result in thicker lines, and a smaller value will create thinner lines.
By adjusting the pen size and experimenting with different settings, you can create unique designs. You can use the SETTHICKNESS and SETCOLOR commands to experiment and see how different combinations of pen color and thickness affect your drawings.
To draw a pattern using different pen sizes, you can use the REPEAT command to make the turtle draw multiple shapes with varying pen thicknesses. For example, you can make the turtle draw a series of circles with increasing thickness:
This command tells the turtle to draw 10 circles, each with an increasing pen thickness, by changing the value of counter each time the loop repeats.
One of the best features of MSWLogo is its ability to create colorful and repetitive patterns using loops. By using the REPEAT command, you can create patterns that use different colors and pen sizes to make your drawing more interesting.
Let’s use a simple loop to create a colorful spiral pattern. The turtle will draw lines, change the pen color, and move in a circular direction. Here is an example of how to create a colorful spiral:
This command tells the turtle to repeat the drawing action 36 times. Each time, it moves forward by 50 steps and turns 10 degrees to the right. The pen color changes each time the loop repeats, creating a colorful spiral effect. You can experiment with different values for the number of repeats, the size of the forward steps, and the angle of rotation to create more complex patterns.
Now that you know how to change the pen color and thickness, let’s create some shapes with varied pen settings. We will draw a polygon where each side is drawn with a different color and thickness.
Here’s a simple way to draw a hexagon (6-sided polygon) with different colors and thickness for each side:
This command will draw a hexagon, changing the pen color and thickness after each side. The turtle will repeat the process 6 times to form the 6 sides of the polygon. You can modify the values of counter to experiment with different colors and thicknesses for each side.
In this chapter, we learned how to use MSWLogo to change the pen color and thickness, experiment with different pen sizes, and create colorful patterns. We also explored how to use loops and commands to draw shapes with varied pen settings, making the drawing process more efficient and creative. MSWLogo provides a fun way to learn programming while creating vibrant and interesting designs.
8 docs|8 tests
|