The document provides instructions on using various commands in MSWLogo to manipulate the turtle's pen size and color, as well as to fill shapes with color. Key commands include SETPENSIZE, SETPENCOLOR, SETFLOODCOLOR, and SETSCREENCOLOR, which allow users to customize drawing attributes and backgrounds. Additionally, it outlines steps for using the menu bar to change these settings and includes activities for practical application.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0 ratings0% found this document useful (0 votes)
37 views10 pages
Chapter 6
The document provides instructions on using various commands in MSWLogo to manipulate the turtle's pen size and color, as well as to fill shapes with color. Key commands include SETPENSIZE, SETPENCOLOR, SETFLOODCOLOR, and SETSCREENCOLOR, which allow users to customize drawing attributes and backgrounds. Additionally, it outlines steps for using the menu bar to change these settings and includes activities for practical application.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
~~ Bw
5WLogo — Using
PenColors
and PenSizes
1. Which command drops the pen of you witt earn about:
the turtc and picks up the eraser? ae _
5 Wd Sed isos SAFER mal SITEINSOL OS
ot + coloring. an object using
Py SER ere eee SETFLOODCOLOR and FILL. commands
Seg * SETSCREENCOLOR command
4. Write the command to drasr are vie
acircle,
@ Introduction
‘You can change the size and color of the pen of the turtle in MSWLogo. This is
done using the SETPENSIZE and SETPENCOLOR commands respectively.
SETPENSIZE command
‘The SETPENSIZE command changes the height and width of the pen of the turtle,
‘SETPENSIZE [NUM1 NUM2]
Here NUM is the height and NUM2 is the width,Height: The height has an insignificant effect on the pen. The height can be
overruled by the FD or BK commands.
Width: The thickness of the pen can be changed in pbeels by using a numeric value.
Pixels are the smallest picture elements.
‘To get the oulput shown in the screenshot
on the right, you need to follow the set of
commands given below.
FD40
SETPENSIZE [5 5]
RT90
rp40
Here the size of the pen is 5 pixels in
thickness with an insignificant effect of
‘The two numeric values piven with the SETPENSIZE command are generally
‘kept the same. However, MSWLogo uses the value for the width only.
Changing pen size using the menu bar
‘You can change the size of the pen using the Menu bar. You need to follow
the steps given below.
1. Click on the Set tab —> PenSize.... option.
2. The Pen Size dialog box opens. Select the pen size you want then click
Changing the pen site wsing the Mena bar Pen Sige dialog boxSETPENCOLOR command
‘This command is used to change the pen color of the turtle. MSWLago uses
the three primary colors — red, blue and green — in different combinations.
‘These combinations make a variety of colors for the pen. Each of these three
colors has 2 number range of 0 to 255. By varying these numbers for all three
colors you can create 16.7 million different colours!
‘Some of the combinations are already made for you. These are:
SETPENCOLOR [000 000000) Black
SETPENCOLOR [255 255255] White
SETPENCOLOR [128 128128] Grey
SETPENCOLOR [255000000] Red
SETPENCOLOR [000 255000] Green
SETPENCOLOR [000000255] Bluc
‘To get the output shown
in the picture on the right,
‘you need to follow the
commands given below.
FD 50
SETPENCOLOR
[000 255 000]
SETPENSIZE [4 4]
RT”
FD 40
Changing the pen color using the Menu bar
‘You can change the pen color using the Menu bar. Follow the steps given
below.
1. Click on the Set tab —e PenColor... option.
2. The Pen Color dialog box appears. Select the color you want thea click
on OK.Pen Color dialog box
‘Complete the following activity.
1 Create a red equilateral triangle with a thick border to look like a clown's hat.
2. Below the triangle, create a circle with a thick yellow border to look like
the clown’s face
Coloring an object
Any figure can be filled with color in MSWLago.
‘Steps to fill color in a figure
1. Set the color of the brush using the SETFLOODCOLOR command
2. Fill the chosen color in an enclosed figure using the FILL command.
SETFLOODCOLOR command
‘The SETHLOODCOLOR command sets the color of the brush. The pen of
the turtle acts as a brush using this command. All the three primary colors with
values ranging from 0 to 255 are used together to make different colors.For example, to set the color blue, you need to give the following command:
SETFLOODCOLOR [0 0 255]
Steps to set FLOODCOLOR using the Menu bar
‘You can do the same by using the Menu bar.
1. Click on Set tah =e FloodColor... option.
2. A Flood Color dialog box opens (Fig. 6.6). Select the color thea click
on OK.
Ree si}
‘avon 1]
| me st
Flood Color dialeg box
FILL command
‘The FILL command uses the
color of the brush, set by using
SETFLOODCOLOR, to flood an
area. Both the commands have to
Work together to give a colorful
abject.
To fill blue color in the given
figure, you need to give the
following commands. To fil blue calor in a square
REPEAT 4 [FD 100 RT 90] SETFLOODCOLOR [0 0 255]
RT 45 FLL
D20
“The color will fll a closed figure when the turtle is inside the figure.‘To create a colored boundary/border for a figure, you need to pive the
following commands.
REPEAT 4 [FD 50 RT 90]: Creates a square with sides 50.
PU: PENUP
RT 35: Sets the direction of the turtle at 35°.
SETFLOODCOLOR [0255 0: Sets the color to be flooded where the turtle
placed.
FILL: Effects of the SETFLOODCOLOR command can be seen.
SETSCAEENCOLOR command
‘The SETSCREENCOLOR command sets the background color of the
screen. You can use the three primary colors in varied combinations to-
obtain different colors.
‘You need to give the following set of commands to create a colored border
triangle on a blue background.
SETSCREENCOLOR [00-255] SETPENCOLOR [255 00]
ETPENSIZE [2 10} REPEAT 3{FD 100 RT 120)
Try these commands lo flood the entire screen with bluc color.
SETH _OODCOLOR [0.0255] FILL,Complete the activity given on page 82 as helow.
I. Fill the clown’s hat with red color.
2. Fill the clown’s face: with yellow color.
3. Change the background color of the screen to blue.
‘Checking the status of the Turtle
‘You might forget about the status of the
turtle afler piving several commands. Status
refers to the position of the pen, the position
of the turtle on the screen, the color of the
background, etc. All this can be checked by
giving the following commands.
STATUS command
‘The STATUS command opens a Status
window. It tells you the current settings of
the turtle.
NOSTATUS command ‘Satur window
“The Status window can be removed from the screen by giving the
NOSTATUS command_
(Chock the status of the rile by clicking on the Status button in the Commander
Window. Ax so00 as you click on il, the Status dialog box appears showing the
excl status ofthe turtle, The Commander Window now show's the NaStats
Sere eee oer
>FILL command Uscs color of the brush to flood an area.
NOSTATUS command Removes the Status window from the screen.
Pixels These are the smallest picture clements,
SETFLOODCOLOR command Sets the color of the brush.
SETPENCOLOR command Gives ink colorte the pen of the turtle
SETPENSIZE command Changes the size of the pen of the turtle.
SETSCREENCOLOR command Sets the color of the background screen,
STATUS command Displays the status of the turtle.
a 1. You cam change the height and width of the pen of the turtle.
2. MSWLogo uses the three primary colors red. blue and green —
f in different combinations. These combinations give different
colors to the pen.
3. The pen ofthe turle acts as a brash using the SETFLOGDCOLOR
command.
4. The SETSCREENCOLOR command uses the three primary
colors in varied combinations to ive different colors to the
background screen.
oom
QO & Aillintheblanks.
scones Command changes the size of the pen of the turtle.
__.. ofthe pen can be changed in pis by using a numeric value,
are the smallest picture elements
command is used to give the ink colorto the pen ofthe turtle
.»- command sets the color of the brush.e
B.
True or false?
1. The SETBACKGROUNDCOLOR command sets the-color
of the background of the screen.
2. Toadd color to an object, itis not necessary to use the
FILL command and SETFLOODCOLOR together.
3. The STATUS command removes the Status window from
thescreen.
“A. The colors range from ta 255.
5. Red, blue and green are secondary colours.
Answer the following questions.
1. How can you change the pen color using the Menu bar?
2. How do you change the size of the pen of the turtle?
3. Give commands to create a colored boundary/border to a given figure.
A. Whatis the purpose of the SETPENSIZE command?
5. How can you show and hide the status of the turtle?
6 Can you fill a square with color by using the following commands in
(MSWLogo? Give reasons,
@. FD 100 RT90FD 100.90 FD 100 RT-90 FD 10RT90
SETFLOODCOLOR (0 255 0] FLL
b, FD 1O0 RT 9UFD 100RT 90 FD 100 RT 90 FD 10 RT90
SETSCREENCOLOR [0 2550] FILL
State the difference between the following.
1. SETPENCOLOR and SETPENSIZE commands
2. SETFLOODCOLOR and SETSCREENCOLOR commands
3. STATUS and NOSTATUS commands(Open the MSW1oge screen and find out the outpat on typing. the following
commands,
1 D530 2. FD50 SETPENCOLOR,
SETPENSIZE [66] SETPENCOLOR, 000 000 255]
RT oO [900 255 000} SETPENSIZE [4 4]
FD 60 SETPENSIZE [6 6] Rrso
FD ap
bees
Make a big circle with 9 smaller and smaller circles inside each other thal share the
‘same centre point using MSWLogo commands. Using SETH_LOODCOLOR, make ten
new colors and fll cach circle with these new cohors
WHO AMI?
| was born on February 29, 1928 in Pretoria, South Africa,
Jam [Link]-known mathematician, computer scientist and an
educator. Iam the inventor of the ogo programming language.