如何仅从在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