adding several conditions in while

6 views
Skip to first unread message

illana dumoulin

unread,
Nov 30, 2022, 1:38:57 PM11/30/22
to netlogo-users
    Hello, 

        We would need your expertise. We are looking to create 3 agents only on patches whose variable close = false and the variable altitudes less than 20 m 

        When we test these conditions individually, it works. However, if they are grouped in the While it no longer works. we tried and, or, ( ) and [ ]. 
 
Here is our piece of code:

to creer-abri
  repeat 3
  [create-Abri 1
    [setxy  random-xcor random-ycor
     set color green
     set size 10
     set shape "house"
      while [closed? = true] [setxy random-xcor random-ycor]
     
  ]]
end


thank you
 Cordially
Reply all
Reply to author
Forward
0 new messages