Basically, my question is how nested loops work in netlogo. I've tried nesting two while loops within each other, but the inner one doesn't seem to behave properly (properly being the way they work in other languages). If I use two different loops though, it works as expected. Do loops in netlogo work similar to labels in assembly language, so that it'll jump to the first while label it notices.
The reason I'm asking is because I've been resorting to using different types of loops with each other, or creating a procedure for the inner loop, which is hurting the readability of my code. Here's an example, where I'm reading in a tab delimited file to assign values to patches:
file-open "map2.txt"
let i max-pycor
let j min-pxcor
while [i >= min-pycor] [
repeat 33 [ask patch j i [
ifelse file-read = 1
[set pcolor white]
[set pcolor black]
]
set j j + 1
]
set i i - 1
]
file-close-all
I want to remove that repeat 33 loop and have a while loop to use with variably sized worlds.