the turtle x points
Example:
forward 50
Explained in lesson:
Logo's turtle
back X , bk X
The turtle backs x points
Example:
back 50
Explained in lesson:
Logo's turtle
left X , lt X
Rotate the turtle left x degrees
Example:
left 90
Explained in lesson:
Logo's turtle
right X , rt X
Rotate the turtle right x degrees
Example:
right 90
Explained in lesson:
Logo's turtle
home
Moves the turtle to center, pointing upwards
Example:
home
Explained in lesson:
Turtle world
setx NUM_x
Move turtle to the specified X location
Example:
setx 100
Explained in lesson:
Turtle world
sety NUM_y
Move turtle to the specified Y location
Example:
sety 200
Explained in lesson:
Turtle world
setxy NUM_X NUM_Y , set pos [ NUM_X NUM_Y ]
Move turtle to the specified location
Example:
setxy 100 100
Explained in lesson:
Turtle world
setheading , seth
Rotate the turtle to the specified heading
Example:
sh 145
Explained in lesson:
Turtle world
arc ANGLE RADIUS
Will create an arc distance RADIUS covering ANGLE angle
Example:
ARC 360 5
Explained in lesson:
Turtle world
ellipse WIDTH HEIGHT
Will create an ellipse with Width and height
Example:
ellipse 80 90
Turtle Motion Queries
pos
Outputs the current turtle position as [ x y ], x or y respectively
Example:
pos
Explained in lesson:
The turtle answer
xcor
Outputs the current turtle position as [ x y ], x or y respectively
Example:
xcor
Explained in lesson:
The turtle answer
ycor
Outputs the current turtle position as [ x y ], x or y respectively
Example:
ycor
Explained in lesson:
The turtle answer
heading
Outputs the current turtle heading
Example:
heading
Explained in lesson:
The turtle answer
towards
Outputs the heading towards the specified [ x y ] coordinates
Example:
towards
Explained in lesson:
The turtle answer
Turtle and Window Control
showturtle , st
Show the turtle
Example:
ht wait st
Explained in lesson:
Controlling the Turtle and Pen
hideturtle , ht
Hide the turtle
Example:
hideturtle
Explained in lesson:
Controlling the Turtle and Pen
clean , cs
Will clear the screen
Example:
fd 60 clean
Explained in lesson:
Logo's turtle
clearscreen , cs
Will clear the screen and return the turtle home
Example:
cs
Explained in lesson:
Logo's turtle
fill
Does a paint bucket flood fill at the turtle's position
Example:
cs repeat 4 [ fd 50 rt 90 ] pu setxy 50 50 pd fill
Explained in lesson:
Background
filled 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:
filled "blue [repeat 4 [fd 100 rt 90]]
Explained in lesson:
Background
label expr
Draw a word (same logic as print) on the graphics display at the turtle location
Example:
label "logo ht
Explained in lesson:
Background
setlabelheight expr
Set the height for text drawn by label, in pixels
Example:
setlabelheight 100 label "Logo ht
Explained in lesson:
Background
wrap
If the turtle moves off the edge of the screen it will continue on the other side
Example:
cs wrap fd 800
Explained in lesson:
The turtle borders
window
The turtle can move past the edges of the screen, unbounded.
Example:
cs window fd 600 rt 90 fd 100 rt 90 fd 70
Explained in lesson:
The turtle borders
fence
If the turtle attempts to move past the edge of the screen it will stop.
Example:
cs fence fd 600 rt 90 fd 100 rt 90 fd 70
Explained in lesson:
The turtle borders
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:
Interactive
labelsize
Outputs the height of text drawn by label, in pixels
Example:
show labelsize
Explained in lesson:
Interactive
Pen and Background Control
penup , pu
Turtle stops leaving a trail
Example:
penup
Explained in lesson:
Controlling the Turtle and Pen
pendown , pd
The turtle will leave a trail
Example:
pendown
Explained in lesson:
Controlling the Turtle and Pen
setcolor X , setpencolor X
Will set the turtle color accroding to the following table
0: black 1: blue 2: lime
3: cyan 4: red 5: magenta
6: yellow 7: white 8: brown
9: tan 10: green 11: aquamarine
12: salmon 13: purple 14: orange
15: gray
Example:
setcolor 1
Explained in lesson:
Colors and printing
setcolor [r,g,b] , setpencolor [r,g,b]
Will set the turtle color accroding to the amount of red , green and blue
Example:
setcolor [50 100 50]
23Tylerr - há 1 ano