A GUIDE TO USING MSW LOGO

This program enables you to write commands and tell the computer what to do. The simplest use is to move an arrow around the screen to draw shapes or to move a turtle through an obstacle course on the floor.

TO MOVE THE ARROW: BACK n - to move the pen backward in the opposite direction to the arrow by <n> spaces, eg. BACK 15, BK 15 or BK :side

FORWARD n - to move the pen forward in the direction of the arrow by <n> spaces, eg. FORWARD 20, FD 20 or FD :side

LEFT n - to turn the arrow through <n> degrees to the left, eg. LEFT 90, LT 90 or LT :angle

RIGHT n - to turn the arrow through <n> degrees to the right, eg. RIGHT 120, RT 120 or RT :angle

TOOLS: CLEARSCREEN or CS - to clear the screen and return the arrow to the centre of the screen.

PENUP or PU - to lift the pen off the paper

PENDOWN or PD - to put the pen down

PENERASE or PE - to erase as it moves

PENPAINT or PPT - to stop erasing mode (default)

SETPENCOLOR [r g b] - where r,g & b is the intensity of each primary colour ranging from 0 to 255 (default = 0 0 0 for black), eg. [255 0 0] is red, [0 255 0] is green, [255 255 0] is yellow (red+green).

SETPENSIZE [w h] - where w is the width and h is the height (default = 1), eg SETPENSIZE [2 2] will double the line width.

PROCEDURES: Select File/Edit from the menu and either type a name for a new procedure or select an existing procedure from the list provided. This brings up an editing screen showing, for example, for a procedure called square:

to SQUARE
fd 100
rt 90
fd 100
rt 90
fd 100
rt 90
fd 100
end

Typing the command SQUARE will then draw a square with length of side equal to 100. You have taught the computer a new word!

REPEAT LOOPS: To simplify a repetitive task, the above procedure becomes:

to SQUARE
REPEAT 4 [FD 100 RT 90]
end

VARIABLES: A letter or a word following a colon (:) becomes a variable just like you use the letters like a, b, n, x, or y in algebra.

to SQUARE :a
REPEAT 4 [FD :a RT 90]
end

You must tell the computer what you want the value of the variable to be. Typing the command SQUARE 200 will then draw a square with length of side equal to 200

ARITHMETIC: The normal arithmetical operations (+, -, *, and /) can be performed on variables. The above procedure could be changed to:

to POLYGON :n :a
REPEAT :n [FD :a RT 360/:n]
end

Typing the command POLYGON 4 200 will also draw a square with length of side equal to 200, but now you can vary the number of sides with the variable :n


Page last updated 23/05/2003 © Copyright, I.D.Lee, Didcot Girls' School.
All rights reserved. The original material provided on this site may not be copied or redistributed without written consent from the school.