Take the 2-minute tour ×

I have been trying for quite some time to show the current coordinates of a turtle in NetLogo. I'm aware that to show one of the coordinates, I could use:

show [xcor] of turtle 0


show [ycor] of turtle 0

But how do I show both coordinates?

Thank you.

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

You can show [list xcor ycor] of turtle 0.

Or, fancier: show [(word "(" xcor ", " ycor ")")] of turtle 0.

share|improve this answer
add comment

From http://ccl.northwestern.edu/netlogo/docs/programming.html#syntax

you can do

show [xcor + ycor] of turtle 5

But not sure if that helps?

sorry.. it doesnt.. 1 sec!

share|improve this answer
yup dude, it doesnt. Tried that out too! haha! What I want is both the coordinates, that adds them up –  aHaH Jan 31 '12 at 11:47
yep.. I know I misread your Q! Not sure if you can in 1 statement? –  kenam Jan 31 '12 at 11:49
i think there is just enquired from a frd earlier. Could do with patch-here. ask turtle [ patch-here ] it returns the coordinates xy –  aHaH Jan 31 '12 at 12:41
@aHaH: if the turtle is on a patch center, then its coordinates are integers, and the same as the coordinates of the patch. but if the turtle isn't on the patch center, then its coordinates are different –  Seth Tisue Nov 19 '12 at 13:01
add comment

Your Answer


