MSW Logo Programming
********************************************************************************
Selected MSW Logo Commands
Command | Action | Short Version |
FORWARD 100 | Turtle moves forward the specified number | FD 100 |
BACK 50 | Turtle | BK 50 |
RIGHT 90 | Turtle turns clockwise the number of | RT 90 |
LEFT 45 | Turtle | LT 45 |
PENUP | Turtle's pen is up. (Doesn't draw as it | PU |
PENDOWN | Turtle's | PD |
PENERASE | Turtle erases as it moves. | PE |
HIDETURTLE | Removes | HT |
SHOWTURTLE | Makes the Turtle visible again. | ST |
CLEARSCREEN | Erases | CS |
HOME | Returns the Turtle to the "home" | HOME |
LABEL [HELLO WORLD] | Displays | - |
SETPENCOLOR 1-15 | Determines pen color according to: | - - |
SOUND [1000 | SOUND | |
SETPENSIZE [10 10] | Sets width and height of the drawing pen. | - -- |
BYE | Exits | - |
MSW Logo.
2. Click
in the Input Box.
3. Type
in the following:
home <Press
Enter>
FD 100 <Press
Enter>
RT 90 <Press
Enter>
FD 100 <Press
Enter>
RT 90 <Press
Enter>
FD 100 <Press
Enter>
RT 90 <Press
Enter>
FD 100 <Press
Enter>
aDDING COLOURS TO MSWLOGO
Pen Color and Screen Color
You can change the color
of the lines that the turtle draws with the SETPENCOLOR command. You can change
the color of the screen (or background) with the SETSCREENCOLOR command.
Command | Example | What Happens |
SETPENCOLOR color | SETPENCOLOR 2 | Sets the color that |
SETSCREENCOLOR color | SETSCREENCOLOR 2 | Fills the entire |
Color Index
The easy way to change
the color of the turtle's pen is to give SETPENCOLOR a number from 0 - 15. Each
number will set the turtle's pen to a different color, given in the table
below. The number is called the "color index".
Color Index | Color Name | [R G B] | Color |
0 | black | [0 0 0] | |
1 | blue | [0 0 255] | |
2 | green | [0 255 0] | |
3 | cyan (light blue) | [0 255 255] | |
4 | red | [255 0 0] | |
5 | magenta (reddish | [255 0 255] | |
6 | yellow | [255 255 0] | |
7 | white | [255 255 255] | |
8 | brown | [155 96 59] | |
9 | light brown | [197 136 18] | |
10 | dark green | [100 162 64] | |
11 | darkish blue | [120 187 187] | |
12 | tan | [255 149 119] | |
13 | plum (purplish) | [144 113 208] | |
14 | orange | [255 163 0] | |
15 | gray | [183 183 183] | |
SETSCREENCOLOR 5
SETPENCOLOR 7
FD 100 <Press Enter>
RT 90 <Press Enter>
FD 100 <Press Enter>
RT 90 <Press Enter>
FD 100 <Press Enter>
RT90 <Press Enter>
RT 90 <Press Enter>
FD 100 <Press Enter>
REPCOUNT COMMMAND
REPEAT COMMAND
Repeated
pattern created using a square:
- Repeat 10 [square rt 36]
- Repeat 12 [square rt 30]
- Repeat 30 [square rt 12]
- Repeat 36 [square rt 10]
Repeated
pattern created using a hexagon:
- Repeat 10 [hexagon rt 36]
- Repeat 12 [hexagon rt 30]
- Repeat 30 [hexagon rt 12]
- Repeat 36 [hexagon rt 10]
0 Comments