I am trying to create turtles and place them randomly along the patches but I cant place them if the patch color is black. Im honestly stuck and cant even think ... This is what I have.
create-mice N-mice
[
set shape "mouse side"
set color 4
setxy random-pxcor random-pycor
]
ask turtles [
while pcolor = black [
setxy random-pxcor random-pycor
]
]
Its giving my an error saying "WHILE expected this input to be a TRUE/FALSE block, but got a TRUE/FALSE instead"
There's an internal reason for this (the difference between a boolean and a reporter that returns a boolean, or something like that) and it always tricks me too.
When you are doing while
, the condition is in []. Note that when you are doing if
, the condition is not in []! Try this:
ask turtles [
while [pcolor = black] [ ; changed the [ ] on this line
setxy random-pxcor random-pycor
]
]