random-xcor3.1 random-ycor3.1

random-xcor random-ycor

Reports a random floating point number from the allowable range of turtle coordinates along the given axis, x or y.

Turtle coordinates range from min-pxcor - 0.5 (inclusive) to max-pxcor + 0.5 (exclusive) horizontally; vertically, substitute -y for -x.

ask turtles [
  ;; move each turtle to a random point
  setxy random-xcor random-ycor
]

See also random-pxcor, random-pycor.

Take me to the full NetLogo Dictionary