Hi all,
I have one problem with my code. I have the wrapping world disable with 5 colors and I want the turtles avoid the patches of blue color. But appears this error: "OF expected input to be a turtle agentset or patch agentset or turtle or patch but got NOBODY instead." Someone can help me? The code below. Thanks!
to setup5
clear-all
set edge-size 10
set-patch-size 50
let pcolors []
set pcolors [15 105 55 45 25]
ask patches [
set pcolor item (random 5) pcolors
]
crt 1 [
set size 1
set color black
]
reset-ticks
end
to go5
ask turtles [
ifelse [pcolor] of patch-ahead 1 = blue
[ lt random-float 360 ]
[ fd 1 ]
if [pcolor] of patch-ahead 1 != nobody
[ fd 1 ]
]
end