How to Use Primitives in MicroWorlds EX - dummies

How to Use Primitives in MicroWorlds EX

By Camille McCue

Primitives are commands that MicroWorlds EX already knows. Typing a primitive into the Command Center (at the bottom of the interface) and then pressing Enter (Windows) or Return (Mac) immediately executes the primitive.

Note that some primitives need an input, such as a number, a word, or a list of words or instructions. When using these primitives, remember to check that they have the right type of input.

Primitive What Current Turtle Does
home Sets coordinates to (0,0) and heading to 0
show who Identifies name of current turtle
fd distance Turtle moves forward distance
bk distance Turtle moves backward distance
glide distance
Turtle moves distance at a
rt angle Turtle turns right angle
lt angle Turtle turns left angle
seth angle Sets turtle heading to angle
pd or pu Turtle puts drawing pen down or pen up
setc color Sets the turtle and its pen to color (for example, blue)
setpensize num Sets the size of the turtle pen
setbg color Sets the background color (for
example, yellow)
setsh shapename Sets the shape of the turtle to shapename
clean Cleans the background, but leaves all objects where they
st or ht Show turtle or hide turtle
pd or pu Turtle puts drawing pen down or pen up
wait time Waits time (in tenths
of a second)
setx xcor Sets the x-coordinate of the turtle to xcor
sety ycor Sets the y-coordinate of the turtle to ycor
setpos [xcor
Sets the coordinates of the turtle to (xcor, ycor)
repeat num
Executes the commands a total
of num times
random num Generates a random number from 0 to num – 1
setvariablename value Sets the variable variablename
to value
t1, commands Assigns t1 as current turtle; t1 executes commands
if condition[consequence] If condition occurs then
execute consequence
everyone [commands] All turtles execute commands
(not just current turtle)