NYT Number Play: Wolves and Sheep
Comments and Questions
Click to Run Model
breed [ wolves wolf ] breed [ sheep a-sheep ] to startup ca ask patches [ set pcolor grey + random-float 5 ] set-default-shape wolves "wolf" set-default-shape sheep "sheep" end to go create-wolves 5 [ oops_go_somewhere_new. ] create-sheep 3 [ oops_go_somewhere_new. ] while [ any? sheep with [ omg_danger_zone! ] ] [ ] ; plug 'til solved end to-report omg_danger_zone! ;; sheep procedure if any? STALKING_WOLVES [ ask one-of ( list self STALKING_WOLVES ) [ ; be a bit smart and move offending animals oops_go_somewhere_new. ] report true ] report false end to-report STALKING_WOLVES ;; sheep procedure report wolves with [ xcor = [ xcor ] of myself or ycor = [ ycor ] of myself or abs( [ xcor ] of myself - xcor ) = abs ( [ ycor ] of myself - ycor ) ] end to oops_go_somewhere_new. move-to one-of patches with [ not any? other turtles-here ] end
There are 2 versions of this model.
This model does not have any ancestors.
This model does not have any descendants.