【发布时间】:2014-11-07 18:01:28
【问题描述】:
我试着问我的海龟:如果最近的海龟的半径低于“距离-min”(全局),那就出去吧!
但是下面的代码不起作用,我真的不明白为什么。
to go
ask boeufs [get-out]
tick
end
to get-out
let x min-one-of boeufs in-radius distance-min [distance myself]
ifelse (x != nobody) [
face x
rt 180
fd 1
set color red
]
[
wiggle
]
end
似乎如果:x 等于乌龟本身…… 条件总是正确的,即使世界上只有 1 只乌龟,为什么? :/
【问题讨论】: