![]() |
demo is running... |
Command
|
Program
|
run |
stop |
clear |
fd 100 forward 100 pixels |
bk 100 back 100 pixels |
lt 90 rotate 90 degrees to the left |
rt 90 rotate 90 degrees to the right |
home move to the center |
clean clear the screen |
cs go home and clear screen |
pu pen up (don't draw) |
pd pen down (draw) |
ht hide turtle |
st show turtle |
setpencolor 0 select black color |
print "text print text on screen |
ct clear text |
setxy 50 50 move to position |
setx 50 move horizontally |
sety 50 move vertically |
seth 90 set turtle to 90 degrees |
arc 360 100 draw a circle around turtle |
repeat 36 [ fd 5 rt 10 ] draw a circle |
fd random 100 forward random length |
to programname :variable
for
[ a 1 10 ] [ fd :a rt 2 ]
rt 90
fd random 100
lt 45
wait 30
fd :variable
if :variable > 1 [
programname :variable - 1
]
end
programname 10
|
You may create your own reusable 'procedures' (or 'programs') using the 'to' and 'end' commands.
Procedures may also include one or more variables.
Procedures can also be used recursively, which mean that they can call themselves.
Once a procedure has been entered, it can be launched like a simple command.
|