Final
Final
move the turtle(s) to xcor = new-x while [test] while [ xcor < 0 ]
setxy new-x new-y and ycor = new-y [ fd 1
[ commands ]
set pcolor green
]
fd n forward n steps
calculates the distance between the turtle (or patch) and the
distancexy xvalue yvalue point (xvlaue, yvalue)
bk n backward n steps
calculates the square root of the expression - mouse-xcor and mouse-ycor are the
sqrt expression (e.g. coordinates (current position) of the
sqrt (xcor * xcor + ycor * mouse
mouse-xcor and mouse-ycor
ycor)) will calculate the distance of this - mouse-down? is true if the mouse
turtle from the origin
mouse-down? button is pressed, false otherwise
mouse-inside? - mouse-inside? is true if the mouse
a mod b calculates the remainder when a is divided cursor is inside the NetLogo visual
by b. e.g. 13 mod 5 is 3 area, false ptherwise
rt n rotate right n degrees let variable1 value1 create variables used only in the current procedure
create variables seen and modifiable throughout the
lt n rotate left n degrees globals [global-variable-1 ...] program
pu pen up turtles-own [property-1 ...] create properties for turtles
pd pen down (draw) patches-own [property-1 ...] create properties for patches
to procedure-name
set size n change size of turtle ... define a procedure
end
to-report reporter-name
set color n
...
(or) change color of turtle define a reporting procedure
report expression
set color color-word
end
who, xcor, ycor, color, shape, size, heading, label, label-
repeat n [ ] repeat n times the commands in [ ] Common properties of a turtle color, pen-size, pen-mode, hidden?, breed
set shape "shape change shape of turtle Common properties of a patch pxcor, pycor, pcolor, plabel, plabel-color
name"
"forever" button continuously submits its commands