Please register and start creating your own cool programs
Turtle Motion
vorwärts X , vw X
Bewege die Schildkröte um x Punkte
Example:
vorwärts 50
Explained in lesson:
rückwärts X , rw X
The turtle back x points
Example:
rückwärts 50
Explained in lesson:
links X , ls X
Schildkröte x Grad nach links drehen
Example:
links 90
Explained in lesson:
rechts X , rs X
Rotate the turtle right x degrees
Example:
rechts 90
Explained in lesson:
mitte
Bewege die Schildkröte in die Mitte, nach oben gerichtet
Example:
mitte
Explained in lesson:
aufx NUM_x
Bewege die Schildkröte zur angegebenen X-Position
Example:
aufx 100
Explained in lesson:
aufy NUM_y
Bewege die Schildkröte zur angegebenen Y-Position
Example:
aufy 200
Explained in lesson:
aufxy NUM_X NUM_Y , set pos [ NUM_X NUM_Y ]
Bewege die Schildkröte zur angegebenen Position
Example:
aufxy 100 100
Explained in lesson:
aufkurs , ak
Rotiere die Schildkröte in die angegebene Richtung
Example:
sh 145
Explained in lesson:
bogen ANGLE RADIUS
Will create an arc distance RADIUS covering ANGLE angle
Example:
ARC 360 5
Explained in lesson:
ellipse WIDTH HEIGHT
Will create an ellipse with Width and height
Example:
ellipse 80 90
Turtle Motion Queries
ort
Outputs the current turtle position as [ x y ], x or y respectively
Example:
ort
Explained in lesson:
ortx
Outputs the current turtle position as [ x y ], x or y respectively
Example:
ortx
Explained in lesson:
orty
Outputs the current turtle position as [ x y ], x or y respectively
Example:
orty
Explained in lesson:
kurs
Gibt die aktuelle Ausrichtung der Schildkröte aus
Example:
kurs
Explained in lesson:
richtung
Outputs the heading towards the specified [ x y ] coordinates
Example:
richtung
Explained in lesson:
Turtle and Window Control
zeigigel , zi
Zeige die Schildkröte
Example:
vi warten zi
Explained in lesson:
versteckigel , vi
Schildkröte verstecken
Example:
versteckigel
Explained in lesson:
bildmitte , bd
Löscht die Bildfläche und bringt die Schildkröte nach Hause
Example:
bd
Explained in lesson:
fülle
Does a paint bucket flood fill at the turtle's position
Example:
bd wiederhole 4 [ vw 50 rs 90 ] sh aufxy 50 50 sa fülle
Explained in lesson:
gefüllt fillcolor [ statements ... ]
Execute statements without drawing but keeping track of turtle movements. When complete, fill the region traced by the turtle with fillcolor and outline the region with the current pen style
Example:
gefüllt "blue [repeat 4 [fd 100 rs 90]]
Explained in lesson:
igeltext expr
Draw a word (same logic as print) on the graphics display at the turtle location
Example:
igeltext "logo vi
Explained in lesson:
texthöhe expr
Set the height for text drawn by label, in pixels
Example:
texthöhe 100 igeltext "Logo vi
Explained in lesson:
envolver
If the turtle moves off the edge of the screen it will continue on the other side
Example:
bd envolver vw 800
Explained in lesson:
ventana
The turtle can move past the edges of the screen, unbounded.
Example:
bd ventana vw 600 rs 90 vw 100 rs 90 vw 70
Explained in lesson:
valla
If the turtle attempts to move past the edge of the screen it will stop.
Example:
bd valla vw 600 rs 90 vw 100 rs 90 vw 70
Explained in lesson:
Turtle and Window Queries
shownp , shown?
Outputs 1 if the turtle is shown, 0 if the turtle is hidden
Example:
show shown?
Explained in lesson:
labelsize
Outputs the height of text drawn by label, in pixels
Example:
show labelsize
Explained in lesson:
Pen and Background Control
stifthoch , sh
Turtle stops leaving a trail
Example:
stifthoch
Explained in lesson:
stiftab , sa
The turtle will leave a trail
Example:
stiftab
Explained in lesson:
farbe X , stiftfarbe X
0: schwarz | 1: Blau | 2: lindgrün |
3: cyan | 4: rot | 5: magenta |
6: Gelb | 7: weiß | 8: Braun |
9: tan | 10: grün | 11: aquamarin |
12: lachs | 13: violett | 14: orange |
15: grau |
Example:
farbe 1
Explained in lesson:
farbe [r,g,b] , stiftfarbe [r,g,b]
Will set the turtle color accroding to the amount of red , green and blue
Example:
farbe [50 100 50]
breite X , stiftbreite X
Setzt die Stiftdicke auf X
Example:
breite 4 vw 50
Explained in lesson:
cambiarforma X or STR , cf X or STR
Will change the turtle to another shape accordin to the following 0 = "turtle", 1 = "cat", 2 = "fish", 3 = "dog", 4 = "horse", 5 = "tiger", 6 = "crab", 7 = "snail"
Example:
cf 1 or cf "dog
Explained in lesson:
Pen Queries
pendownp , pendown?
Outputs 1 if the pen is down, 0 otherwise
Example:
show pendown?
Explained in lesson:
pencolor , pc
Outputs the current pen color. This will be a CSS color string, not necessarily the value passed in.
Example:
show pencolor
Explained in lesson:
pensize
Outputs a two element list with the pen width and height (usually the same).
Example:
show pensize
Explained in lesson:
Procedure Definition
lerne PROCNAME inputs ... statements ... end
Define a new named procedure with optional inputs
Example:
lerne TURTLE wiederhole 4 [ vw 50 rs 90] ende
Explained in lesson:
define PROCNAME inputs ... statements ... end
Define a new named procedure with optional inputs
Example:
define "star [[n][repeat 5 [fd :n rs 144]]]
def PROCNAME
Outputs the definition of a named procedure as a string
Example:
show def "star
Variable Definition
setze varname expr
Update a variable or define a new global variable. The variable name must be quoted
Example:
setze "foo 5
Explained in lesson:
name expr varname
Like make but with the inputs reversed
Example:
name 5 "myvar
Explained in lesson:
localmake varname expr
Define a variable in the local scope (shortcut for local then make
Example:
localmake "myvar 5
Explained in lesson:
: VARNAME , thing VARNAME
Outputs the value of variable. :foo is a shortcut for thing "foo
Example:
show thing "myvar
Explained in lesson:
Control Structures
wiederhole X [ statements ... ]
Repeat statements X times
Example:
wiederhole 4 [ vw 50 rs 90]
Explained in lesson:
für controllist [ statements ...]
Typical for loop. The controllist specifies three or four members: the local varname, start value, limit value, and optional step size
Example:
für [i 1 10 1] [print :i]
Explained in lesson:
whzahl
Outputs the current iteration number of the current repeat or forever
Example:
wiederhole 4 [ whzahl ]
wenn expr [statement]
Execute statment if expressoin is true
Example:
wenn 2>1 [print "hello]
wennsonst expr [statementTrue] [statementFalse]
Execute StatementTrue if tru else execute statementFalse
Example:
wennsonst 0>1 [print "true] [print "false]
test expr
Test the specified expression save the result in the local scope for the subsequent use by iftrue iffalse
Example:
test 3>4 wennwahr [print "true] wennfalsch [print "false]
wennwahr [statements]
Example:
test 3>4 wennwahr [print "true] wennfalsch [print "false]
wennfalsch [statements]]
Example:
test 3>4 wennwahr [print "true] wennfalsch [print "false]
warten X
Will cause the turtle to wait X ( 60ths of seconds ) time before executing the command
Example:
wiederhole 4 [ warten 10 vw 50]
Explained in lesson:
adios
Ternimante the program
Example:
adios
dotimes [varname times] [ statements ...]
Run the statements the specified number of times. The variable varname is set to the current iteration number.
Example:
dotimes [ i 5 ] [ show :i * :i ]
do.while [ statements ...] expr
Runs the specified statements at least once, and repeats while the expression is non-zero (true).
Example:
do.while [ setze "a zz 10 show :a ] :a < 8
while [expr] [ statements ...]
Runs the specified statements only while the expression remains non-zero (true).
Example:
while (random 2) = 0 [ show "zero ] show "one
do.until [ statements ...] [expr]
Runs the specified statements at least once, and repeats while the expression is zero (false).
Example:
do.until [ setze "a zz 10 show :a ] :a < 8
until [expr] [ statements ...]
Runs the specified statements only while the expression remains zero (false).
Example:
until (random 2) = 0 [ show "one ] show "zero
Listen
liste thing1 thing2 ...
Create a new list from the inputs
Example:
setze "mylist (list "turtle "academy)
Explained in lesson:
erstes listname
Gibt das erste Element der Liste aus
Example:
drucke erstes :mylist
Explained in lesson:
ohneerstes listname
Outputs all the items of listname except for the first item
Example:
drucke ohneerstes :mylist
Explained in lesson:
letztes listname
Gibt den letzten Eintrag der Liste aus.
Example:
drucke letztes :mylist
Explained in lesson:
ohneletztes listname
Outputs all the items of listname except for the last item
Example:
drucke ohneletztes :mylist
Explained in lesson:
element index listname
Outputs the indexlist item of the list or array
Example:
drucke element 1 :mylist
Explained in lesson:
wähle index listname
Gibt ein zufälliges Element der Liste aus
Example:
drucke wähle :mylist
Explained in lesson:
Mathe
minus X Y
return the distance between x and y x-y
Example:
drucke minus 8 2
zz X
Will choose a random number between 0 - (X-1)'
Example:
bd drucke summe zz 10 3
Explained in lesson:
modulo expr expr
Outputs the remainder (modulus). For remainder and % the result has the same sign as the first input; for modulo the result has the same sign as a the second input.
Example:
bd drucke modulo 10 3
power expr expr
3 power 4 = 81
Example:
show power 3 4
Receivers
leerpalabra
Prompt the user for a line of input. The result (including spaces) is the single word output.
Example:
setze "name (readword [What is your name?]) show :name
Explained in lesson:
leerlista
Prompt the user for a line of input. The result is a list of words.
Example:
setze "colors (readlist [Type some colors:]) show :colors
Predicates
word thing , word? thing
Returns true (1) or false (0) if thing is a word
Example:
show word "hello
listp thing , list? thing
Returns true (1) or false (0) if thing is a list
Example:
drucke listp [1 2 3]
arrayp thing , array? thing
Returns true (1) or false (0) if thing is an array
Example:
drucke arrayp array 2
numberp thing , number? thing
Returns true (1) or false (0) if thing is a number
Example:
drucke numberp 25
emptyp thing , empty? thing
Test if thing is an empty list or empty string.
Example:
drucke emptyp []
equalp expr expr , equal? expr expr
Test if xper expr are equal.
Example:
equalp "no "yes
notequalp expr expr , notequal? expr expr
Test if xper expr are not equal.
Example:
notequalp "no "yes
beforep thing1 , before? thing1
Test string collation order.
Example:
drucke before? "bye "hi
substringp thing1 thing2 , substring? thing1 thing2
Test if thing1 is a substring of thing2.
Example:
drucke substringp "hello "helloworld