Command List
Here are a list of commands that affect the display.
clear-command-center (cc)
Description:
Clears the command center it is called from. An observer calling cc
will clear the observer command center while a turtle calling cc
will clear the turtle command center.
clear-graphics (cg)
Description:
Sets all patches to black.
clear-info (clearinfo)
Description:
Clears the Information Window.
Related Commands:
clear-output
clear-output (co)
Description:
Clears all the text in the output window.
Related Commands:
clear-info
clear-patches
Description:
Sets all patches to black and resets all patch variables to 0.
clear-plot (clearplot)
Description:
Clears everything drawn by all plot pens in the current plot window, and resets all pens to (0, 0) and their original colors.
Related Commands:
clearplots
plot
clear-turtles (clearturtles) (ct)
Description:
Clears (kills) all of the turtles.
clearall (ca) (clear-all)
Description:
Kills all turtles, sets all patches to black, and resets all variables to 0.
display
Description:
Turns Graphics Canvas updating on.
Notes:
By default, display is on.
Related Commands:
no-display
inspect-patch
xcor ycor
Parameters:
Description:
Brings up the patch monitor of the patch whose coordinates are (xcor, ycor). A patch monitor allows the user to see all of the information about a patch in real time.
Examples:
inspect-patch 1 1
brings up the patch monitor for the patch at coordinates (1,1).
Related Commands:
inspect-turtle
inspect-turtle
number
Parameters:
number |
Number |
&who number& of turtle to inspect |
Description:
Brings up the turtle monitor of the turtle whose who number
is number. A turtle monitor allows the user to see all information about a turtle in real time.
Examples:
inspect-turtle 1
brings up the turtle monitor of the turtle with who number
equal to one.
Related Commands:
inspect-patch
mouse-down?
Description:
Returns a boolean. If any of the mouse buttons are clicked, it returns true. If the mouse buttons all are not clicked, it returns false.
Related Commands:
mouse-xcor
mouse-ycor
mouse-xcor
Description:
Returns the value of the xcor where the mouse was most recently.
Examples:
Run this code in a forever button:
seth towards mouse-xcor mouse-ycor fd .5
Turtles will follow the mouse (pointer tool) around the graphics canvas.
Related Commands:
mouse-down?
mouse-ycor
mouse-ycor
Description:
Returns the value of the ycor where the mouse was most recently.
Examples:
Run this code in a forever button:
seth towards mouse-xcor mouse-ycor fd .5
Turtles will follow the mouse (pointer tool) around the graphics canvas.
Related Commands:
mouse-down?
mouse-xcor
no-display
Description:
Turns off Graphics Canvas updating. (By default, Graphics Canvas updating is on.) Preliminary experiments show a 25x speedup for a test of 100 turtles moving forward 100 steps. Anything graphics intensive should speed up dramatically with the display turned off.
Related Commands:
display
print
string/numbers
Parameters:
Description:
Prints the string/numbers in the output window followed by a carriage return.
Examples:
print color-of 0
prints the color of the turtle with who
0.
Related Commands:
print-status
show
type
print-status
string/numbers
Parameters:
Description:
Prints the
string/numbers to the status bar. The status bar is located at the bottom left of the Interface Window, to the right of the X and Y coordinates.
It prints to the browser's status bar when a project is running as an applet.
Examples:
print-status color-of 0
prints the color of the turtle with who
0.
Related Commands:
print
show
type
screen-half-height
Description:
Returns half of the height of the screen.
Related Commands:
screen-half-width
screen-height
screen-width
screen-half-width
Description:
Returns half of the width of the screen.
Related Commands:
screen-half-height
screen-height
screen-width
screen-height
Description:
Returns the height of the screen. The height is always an odd number, and the lowest possible value is 3. To change the screen-height
, drag the mouse over the graphics canvas and use the handles to resize it.
Related Commands:
screen-half-height
screen-half-width
screen-width
screen-width
Description:
Returns width of the screen. The width is always an odd number, and the lowest possible value is 3. To change the screen-width
, drag the mouse over the graphics canvas and use the handles to resize it.
Related Commands:
screen-half-height
screen-half-width
screen-height
show
anything
Parameters:
Description:
Prints anything in the command center that calls show.
Related Commands:
print
print-status
type
type
expression
Parameters:
expression |
Anything |
The value you want to print |
Description:
Prints expression in the output window. No carriage return to the next line is printed.
Related Commands:
print
print-status
show
view-plot
Description:
Opens the plot window for the currently selected plot.
Related Commands:
plot
plotid