[Documents]

Use one command in each line.
The draw area of the KLogo-Turtle is 590 x 400 steps.
The variable names are not case sensitive.
The numbers are positive integers.

The commands of the KLogo-Turtle:

 

FORWARD
Move forward producing a line.

Format:
FORWARD ?? (?? is the quantity of steps)

Shortcut: FD

Example:
FORWARD 50

 

BACKWARD
Move backward producing a line.

Format:
BACKWARD ?? (?? is the quantity of steps)

Shortcut: BK

Example:
BACKWARD 50

 

LEFT
Rotate left changing the direction.

Format:
LEFT ?? (?? is the quantity of degrees)

Shortcut: LT

Example:
LEFT 90

 

RIGHT
Rotate right changing the direction.

Format:
RIGHT ?? (?? is the quantity of degrees)

Shortcut: RT

Example:
RIGHT 90

 

SETX
Move to a given position on the X axis.

Format:
SETX ?? (?? is the position, where 0 is the center of the window)

Shortcut: SX

Example:
SETX 100

 

SETY
Move to a given position on the Y axis.

Format:
SETY ?? (?? is the position, where 0 is the center of the window)

Shortcut: SY

Example:
SETY 100

 

PENDOWN
Put the pen down on the drawing. In other words, begin drawing lines.

Format:
PENDOWN

Shortcut: PD

Example:
PENDOWN

 

PENUP
Lift the pen up from the drawing. Move the cursor but don't produce a line.

Format:
PENUP

Shortcut: PU

Example:

PENUP

 

PENCOLOR
Change the pen color. Color can be Green, Red, Blue, Black, Yellow, Gray, Darkblue, Darkgreen, Darkred, Darkyellow.

Format:
PENCOLOR ?? (?? is the color)

Shortcut: PC

Example:

PENCOLOR RED

 

CLEAR
Clear the screen.

Format:
CLEAR

Shortcut: CS

Example:

CLEAR

 

HOME
Move to center position.

Format:
HOME

Shortcut: HM

Example:

HOME

 

HIDETURTLE
Hide cursor.

Format:
HIDETURTLE

Shortcut: HT

Example:

HIDETURTLE

 

SHOWTURTLE
Show cusor.

Format:
SHOWTURTLE

Shortcut: ST

Example:

SHOWTURTLE

 

NEW
Start a new drawing.

Format:
NEW

Example:

NEW

 

MAKE
Define a variable with a integer number.

Format:
MAKE name = ?? (?? is a integer number)

Example
(define variable TEST with 100):
MAKE TEST = 100

 

SHOW
Show the content of the variable.

Format:

SHOW variable

Example:
CONTENT TEST

 

SUM
Sum two positive integers and put result into a variable.

Format:
SUM variable = ?? + ?? (?? is a integer number)

Example:

SUM TEST = 10 + 20

 

SUBTRACT
Subtract two positive integers and put result into a variable.

Format:
SUBTRACT variable = ?? - ?? (?? is a integer number)

Example:
SUBTRACT TEST = 30 - 10

 

MULTIPLY
Multiply two positive integers and put result into a variable.

Format:
MULTIPLY variable = ?? * ?? (?? is a integer number)

Example:

MULTIPLY TEST = 20 * 20

 

DIVIDE
Divide two positive integers and put result into a variable.

Format:
DIVIDE variable = ?? / ?? (?? is a integer number)

Example:

DIVIDE TEST = 30 / 5

 

REMAINDER
Divide two positive integers and put remainder into a variable.

Format:
REMAINDER variable = ?? / ?? (?? is a integer number)

Example:

REMAINDER TEST = 50 / 6

 

REPEAT
Repeat a set of commands several times.

Format:
REPEAT ?? (?? is the quantity of times)
commands
END REPEAT

Example
(draw a spiral):
MAKE a = 1
REPEAT 120
FORWARD a
RIGHT 20
SUM a = a + 1
END REPEAT

 

TO
Define a set of commands with a single name.

Format:
TO name
commands
END TO

Example
(define a square and draw it):
TO SQUARE
FORWARD 50
LEFT 90
FORWARD 50
LEFT 90
FORWARD 50
LEFT 90
FORWARD 50
LEFT 90
END TO
SQUARE

 

IF
Execute the commands if condition is true.

Format (=, <, >, !):
IF ?? = ?? (?? is integer number)
commands
END IF

Example
(draw a line):
IF 10 < 100
FORWARD 50
END IF