With the following procedure, I get an "expected closing bracket" error, with highlighting on first use of the word "magenta".
to grow-food-crops
if (pcolor = green) and (corn-amount <= 1000) [ ; only work to grow food if running low
ifelse not any? (patches with [ pcolor magenta ]) [
move-to one-of patches with [ pcolor = yellow ] ; start new food crop garden
set pcolor magenta ; to designate new garden with new pcolor
]
[ move-to one-of patches with [ pcolor = magenta ]
] ; go to work on food crop garden another started
set energy energy - 1 ; work on food crops takes energy
set food-crop-growth food-crop-growth + 1 ; as food crops worked on, crop grows
if food-crop-growth >= 100 [
set food-crop-growth 0
set corn-amount 1000
]
]
end