As the following test illustrates, if a turtle is running a while
when it dies, this breaks out of the while
(without any error). Is this behavior guaranteed by NetLogo?
to test
ca
let age 0
crt 1
ask turtle 0 [
while [true] [
set age (1 + age)
print (word "age is " age)
if (random-float 1 < 0.1) [die] ;death ends the while
]
]
end