6

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

or

show [ycor] of turtle 0

But how do I show both coordinates?

Thank you.

buc
  • 6,268
  • 1
  • 34
  • 51
aHaH
  • 223
  • 2
  • 6
  • 16

3 Answers3

11

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

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

Nicolas Payette
  • 14,847
  • 1
  • 27
  • 37
3

if you don't know the exact turtle (of turtle 5) who's coordinates you would like to show but you want to identify the position of specific turtle running a process you can use just

show list xcor ycor  ; not need to use self or myself
Seth Tisue
  • 29,985
  • 11
  • 82
  • 149
maycca
  • 3,848
  • 5
  • 36
  • 67
-4

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!

kenam
  • 125
  • 8
  • 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