NYT Number Play: Wolves and Sheep
Model was written in NetLogo 5.0.1
•
Viewed 500 times
•
Downloaded 33 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
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.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
NYT Number Play: Wolves and Sheep.png | preview | A solution | over 11 years ago, by Michelle Wilkerson-Jerde | Download |
This model does not have any ancestors.
This model does not have any descendants.
Michelle Wilkerson-Jerde
Inspired by NYT Blog Column "Numberplay"
http://wordplay.blogs.nytimes.com/2012/08/13/numberplay-wolves/?src=recg
Posted over 12 years ago