I am very new to netlogo so this is probably a very basic question, but I am stuck. I want to use a while loop (so the commands keep occurring throughout the run) and patch color to dictate how the turtle will move.
If the turtle is not on a red patch, I want it to keep moving towards the closest red patch.
If it is on a red patch, I want it to stay on the patch
while [pcolor] of patch-here != red
[
face min-one-of patches with [pcolor = red ] [ distance myself ]
forward 1
]
while [pcolor] of patch-here = red
[
stop
]
When I run this, I get an error (with '[pcolor] of patch-here != red" highlighted) that says "While expected this input to be a TRUE/False block, but got a TRUE/FALSE instead."
Can anyone help me out?