CPSC120
Fundamentals of Computer Science

In-class Activity 34

  1. Write a body to the update method of the Wolf class. The method should modify the location of a wolf so that wolf wanders in a random direction.

  2. Write a body to the update method of the World class. The method should update the location of every wolf and rabbit.

  3. Modify the update method of the World class so that if a wolf overlaps with a rabbit, the rabbit is removed from the simulation.