如何从存在于x轴直线上的海龟中“随机选择”一只海龟的“ x坐标”?

时间:2020-06-15 03:07:48

标签: netlogo

如何仅从在x轴上直线存在的海龟中随机选择的海龟的x坐标获取变量并将其设置为变量? 例如,这是一个示例代码,但是不起作用。

  globals [x-only]
  ;omitted
  ask one-of turtles with [xcor < max-pxcor and  pycor < 1 and pycor > -1][
   set x-only list xcor ycor  ;I might be wrong here, but there are no good syntax.
   move-to patch x-only 1
  ]
  ;omitted

0 个答案:

没有答案