Instructions are separeted by space,
[....] is used for a list.
Lower-case letters are changed in upper-case. so you can write FW, fw, Fw or
fW ...
Primitives defined:
PD : Pencil is down and turtle move and draw
PU : Pencil is down and turtle move without drawing
HT : Hide turtle
ST : Show turtle
CLEAN : All drawing are erased and turtle stay in current position
CS : All drawing are erased and turtle is in initial position and heading
Moving turtle
FD n : Turtle go forward of n in current direction
BK n : Turtle go backward of n in current
direction
RT n : Turtle turn on right of n degree
LT n : Turtle turn on left of n degree
Procedures
REPEAT n [..... instructions ... ] : repeat n
times instructions in [..... ]
TO name ... instructions ... END : create procedure with name and
variables
Example:
TO SQUARE REPEAT 4 [FD 100 RT 90] END create procedure SQUARE
If you write SQUARE, a square with 100 for side will be drawed at position of
turtle and account consideration of heading.
A procedure can be used in definition another,
if SQUARE is defined, you can create:
TO DRAWING REPEAT 8 [RT 45 SQUARE] END
Writing DRAWING, you get 8 squares with same vertice and turning of 45° one
after one.
Variables
:Name_variable : This variable is defined with a procedure or with GIVE.
Example:
TO SQUARE :DIM :ANGLE RT :ANGLE REPEAT 4 [FD :DIM RT 90] END create procedure
SQUARE
If you write SQUARE 50 45, turtle turn of 45° on right and draw a square with
50 for side.
MAKE "Name_variable value: Variable get value, this value can be number or other variable with operations. Example if :X has 100 as value MAKE "Y :X / 2 create :Y with 50 as value.
Conditional execution
IF condition [instructions if true] [instructions if false] :
Operators
+ - * / : This 4 operations are defined on numbers or variables.