I created a grid containing several rectangles. These rectangles are represented by several orange patches and each rectangle is delimitated by white corridors.
How can I color patches within a given orange rectangle ?
Thanks in advance.
This is a beginning of code :
to create-yellow-patches
ask one-of patches with [pcolor = orange] [
set pcolor yellow
foreach list pxcor to max-pxcor [ ;; I don't know how to define a list from pxcor to max-pxcor
let x ?
foreach list min-pycor to max-pycor [ ;; I don't know how to define a list from min-pycor to max-pycor
let y ?
ifelse [pcolor] of patches with [pxcor = x and pycor = y ] = orange
[ set pcolor yellow ]
[ break ] ] ] ;; I don't know what is the equivalent of break in netlogo
foreach pxcor - 1 to min-pxcor [ ;; I don't know how to define a list from pxcor - 1 to min-pxcor
let x ?
foreach min-pycor to max-pycor [ ;; I don't know how to define a list from min-pycor to max-pycor
let y ?
ifelse [pcolor] of patches with [pxcor = x and pycor = y ] = orange
[ set pcolor yellow ]
[ break ] ] ] ;; I don't know what is the equivalent of break in netlogo
end