CS112
Assignment #8
Due: March 27th
For this assignment you will be expanding the simple Humans versus
Zombies program we've been developing in class.
Include the following features in the
Humans versus Zombies program (you may continue building on your current
program or start over from one of the on-line versions from the schedule):
- Add a new breed: dogs dog.
- Give the dogs their own shape.
- When the dogs move they should move towards the closest zombie within 3.
If there are no zombies within 3 then the dogs should move towards the closest
human.
- Dogs should occasionally hatch from other dogs.
- Dogs should be able to fight zombies. For example, one dog counts as 2 zombies and the majority
wins.
- Add another type of specialized patch that has an affect on
humans, zombies, or dogs. Possiblities include: patches that heal humans,
patches
that humans amd zombies can't enter (barriers), patches only humans can
enter (buildings), patches where humans kill zombies, patches that "sprout"
dogs, etc.
- Fill in the info tab. Include your name under "What is it?"
Make sure to fill in all of the other sections. Be sure to include a
discription of
the model. What the patches do, when dogs hatch, etc.
- In addition to the programming assignment go to
www.processing.org and install Processing. Like NetLogo
Processing comes with a library of examples, try a few of them to make sure that Processing is
running correctly.
Turn in: Save your project as [scratchname]Zombies3.nlogo. E.g. my project would be saved as
tsoule89Zombies3.nlogo (without the []'s). Email the project as an
attachment to both TAs
Allen, Craig (alle7522@vandals.uidaho.edu); MacPhereson, Serendel (macp6269@vandals.uidaho.edu).
Make the subject of the email CS112Assignment8.
Note: to make the dogs move properly you will need an ifelse statement with a Boolean and,
like:
ifelse( count zombies > 0 and (distance (min-one-of zombies [distance myself]) < 3))
[ ;; if part
;; Code for dogs to move toward zombies
]
[ ;; else part
;; Code to move toward humans, remember to check if there are any humans left
[