Get turtle's X or Y coordinate

xcor
ycor

Returns single coordinate of a turtle's current position.

Example:

repeat 4 [
  (print xcor ycor)
  fd 50 rt 90
]

Output:

0 0
0 50
50 50
50 0

See also:

Table of Content