How to Use Primitives in MicroWorlds EX

By Camille McCue

Part of Coding For Kids For Dummies Cheat Sheet

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
steps
bk distance Turtle moves backward distance
steps
glide distance
speed
Turtle moves distance at a
speed
rt angle Turtle turns right angle
degrees
lt angle Turtle turns left angle
degrees
seth angle Sets turtle heading to angle
degrees
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
are
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
ycor
]
Sets the coordinates of the turtle to (xcor, ycor)
repeat num
[commands]
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)