Command List

Here are a list of commands that affect the display.

Turtle, Observer

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.

Observer

clear-graphics (cg)

Description:
Sets all patches to black.

Observer

clear-info (clearinfo)

Description:
Clears the Information Window.

Related Commands:
clear-output
Observer

clear-output (co)

Description:
Clears all the text in the output window.

Related Commands:
clear-info
Observer

clear-patches

Description:
Sets all patches to black and resets all patch variables to 0.

Observer

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
Observer

clear-turtles (clearturtles) (ct)

Description:
Clears (kills) all of the turtles.

Observer

clearall (ca) (clear-all)

Description:
Kills all turtles, sets all patches to black, and resets all variables to 0.

Observer

display

Description:
Turns Graphics Canvas updating on.

Notes:
By default, display is on.

Related Commands:
no-display
Observer

inspect-patch xcor ycor

Parameters:
xcor Number
ycor Number

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
Observer

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
Turtle, Observer, 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
Turtle, Observer, Patch

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
Turtle, Observer, Patch

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
Observer

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
Turtle, Observer, Patch

print string/numbers

Parameters:
string/numbers Anything

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
Turtle, Observer, Patch

print-status string/numbers

Parameters:
string/numbers Anything

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
Turtle, Observer, Patch

screen-half-height

Description:
Returns half of the height of the screen.

Related Commands:
screen-half-width screen-height screen-width
Turtle, Observer, Patch

screen-half-width

Description:
Returns half of the width of the screen.

Related Commands:
screen-half-height screen-height screen-width
Turtle, Observer, Patch

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
Turtle, Observer, Patch

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
Turtle, Observer, Patch

show anything

Parameters:
anything Anything

Description:
Prints anything in the command center that calls show.

Related Commands:
print print-status type
Turtle, Observer, Patch

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
Turtle, Observer, Patch

view-plot

Description:
Opens the plot window for the currently selected plot.

Related Commands:
plot plotid