December 2015
Intermediate to advanced
400 pages
13h 3m
English
There is currently a bug in the Zombie type. If an instance of Zombie terrorizes a town with a population of 0, then its population will decrement to -10. This result does not make sense. Fix this bug by changing the terrorizeTown() function on the Zombie type to only decrement the town’s population if its population is greater than 0. Also, make sure that the town’s population is set to 0 if the amount to decrement is greater than the current population.
Read now
Unlock full access