タートルを視覚的に最も近い赤または緑のカラー パッチに移動したいです。このコードを試しましたが、動きません。何が問題なのですか?
while [collectedDirt = 5]
[
ask turtle 0 [
let nearest-patch min-one-of (patches with [pcolor = red or pcolor = green] in-cone 15 20)[distancemyself]
face nearest-patch
fd distance nearest-patch
]
set collectedDirt collectedDirt + 1
search-dirt ;; research whether there is red patch in-cone because of new position
]