Home Up Contents Search

Commands

Command

Abbreviation

Input

Description

FORWARD

FD

number of turtle steps

Moves turtle forward

BACK

BK

number of turtle steps

Moves turtle backward

RIGHT

RT

number of degrees

Rotates turtle right

LEFT

LT

number of degrees

Rotates turtle left

REPEAT

-

number of times, list of commands

Repeats list of commands a number of times

HOME

-

-

Sets turtle at centre of screen and pointing up

CLEAN

-

-

Erases drawing screen

CLEARSCREEN

CS

-

Combines effects of HOME and CLEAN

HIDETURTLE

HT

-

Hides the turtle

SHOWTURTLE

ST

-

Shows the turtle

PENUP

PU

-

Raises turtle pen

PENDOWN

PD

-

Lowers turtle pen

PENERASE

PE

-

Erases lines that turtle retraces

PENPAINT

PP

-

Restores the pen after PENERASE

PENREVERSE

PX

-

Reverses turtle pen colour

SOUND

-

frequency, duration

Exercises the PC speaker.

SETPENCOLOR

SETPC

3 numbers for pen colour

Sets pen colour

SETFLOODCOLOR

SETFC

3 numbers for fill colour

Sets fill colour for fill command

SETSCREENCOLOR

SETSC

3 numbers for screen colour

Sets screen colour immediately

FILL

-

-

Fills a closed region using current flood colour

MAKE

-

variable name, value

Sets a variable name to a nominated value

NAME

-

value, variable name

Alternative for MAKE command

BYE

-

-

Exits MSW Logo
 

Some Examples

Command Example Action

Shortcut

FORWARD 100 Turtle moves forward the specified number of units.

FD 100

BACK 50 Turtle moves back the specified number of units.

BK 50

RIGHT 90 Turtle turns clockwise the number of degrees specified (in this case 90 degrees).

RT 90

LEFT 45 Turtle turns counterclockwise 45 degrees.

LT 45

REPEAT 6 [FD 100 RT 60] Repeat list of commands in […] 6 times.

-

LABEL [HELLO WORLD] Displays text at the Turtle location.

-

SOUND [1000 200] SOUND [<frequency> <duration>] where "frequency" is in Hz and "duration" is in 1000ths of a second.

-

SETPENSIZE [10 10] Sets width and height of the drawing pen. MSW Logo uses only the second value. Set them both the same.

-

SETPENCOLOR [0 0 0]

SETPENCOLOR [n1 n2 n3] determines pen colour where n1, n2, and n3 are each numbers between 0 and 255 inclusively. For example:

SETPENCOLOR [0 0 0] = Black
SETPENCOLOR [0 0 255] = Blue
SETPENCOLOR [0 255 0] = Light Green
SETPENCOLOR [0 255 255] = Light Cyan
SETPENCOLOR [255 0 0] = Red
SETPENCOLOR [255 0 255] = Light Magenta
SETPENCOLOR [255 255 0] = Yellow
SETPENCOLOR [255 255 255] = White
SETPENCOLOR [155 96 59] = Dark Brown
SETPENCOLOR [197 136 18] = Light Brown
SETPENCOLOR [100 162 64] = Green
SETPENCOLOR [120 187 187] = Cyan
SETPENCOLOR [255 149 119] = Apricot
SETPENCOLOR [144 113 208] = Purple
SETPENCOLOR [255 163 0] = Orange
SETPENCOLOR [183 183 183] = Grey






SETPC 0
SETPC 1
SETPC 2
SETPC 3
SETPC 4
SETPC 5
SETPC 6
SETPC 7
SETPC 8
SETPC 9
SETPC 10
SETPC 11
SETPC 12
SETPC 13
SETPC 14
SETPC 15

SETFLOODCOLOR [0 0 0] SETFLOODCOLOR [n1 n2 n3] sets fill colour for fill command where n1, n2, and n3 are each numbers between 0 and 255 inclusively.

SETFC 0

SETSCREENCOLOR [0 0 0] SETSCREENCOLOR [n1 n2 n3] sets screen colour immediately where n1, n2, and n3 are each numbers between 0 and 255 inclusively.

SETSC 0

MAKE "NUMBER 15 Sets a variable name, NUMBER to a nominated value, 15

-

NAME 15 "NUMBER Alternative for MAKE command

-

 
 
Next
Send mail to ljschwerin@hotmail.com with questions or comments about this web site.

Copyright © 1999-2002 Leon Schwerin
Last modified: 25 March 2000
1