Logo primitives

25,862 views 12 slides Mar 11, 2012
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

Explains basic logo primitives (commands)


Slide Content

Logo PrimitivesLogo Primitives

Primitives
•Built in words in Microworlds Logo
that tell the application what to do.
•Example: fd, bk, show, pos

fd (forward)
•Definition: Moves the turtle forward.
–Syntax: fd number
•Example: fd 20
•Notes:
–The turtle leaves a trace if its pen is down
–The maximum number is 9999

bk (back)
•Definition: Moves the turtle backwards
–Syntax: bk number
•Example: bk 50
•Notes:
–The turtle leaves a trace if its pen is down
–The maximum number is 9999

rt (right)
•Definition: Turns the turtle to the
right
–Syntax: rt number
•Example: rt 90
•Notes:
–The maximum number is 9999

lt (left)
•Definition: Turns the turtle to the
left.
–Syntax: lt number
•Example: lt 90
•Notes:
–The maximum number is 9999

Degrees

pd (pen down)
•Definition: Puts down the pen of the
current turtle. The turtle will then
leave a trace when it moves.
•Example: pd
•Notes: It does not leave a trace if it
is dragged.

pu (pen up)
•Definition: Lifts the pen of the
current turtle. The turtle will not
leave a trace when it moves.
•Example: pu

setc (set pen color)
•Definition: Sets the color of the turtle’s
pen.
–Syntax: setc name or number
•Example: setc “red
setc 16
•Notes:
–If the turtle has its original shape it will show the color
–If using a name input you must use a “ before the name.

setpensize
•Definition: Sets the pen size of the
turtle
–Syntax: setpensize number
•Example: setpensize 20
•Notes:
–The original pen size is 1.
–The maximum pen size is 100.

seth (set heading)
•Definition: Sets the turtle’s heading
to the specified direction (in
degrees)