CompSci 4 - Classwork - Oct 4, 2005
5 pts
Today's classwork is review for the exam, and focuses
on writing Alice code.
- Write a method that takes two object parameters called person and
animal and does the following. (When moving the objects you can just
move them, you do not have to make it look like they are walking).
- The two should face each other.
- The animal should move to the person, stopping about 1 meter from the
person.
- The animal should circle the person, then say "Catch me if you can",
and then turn away from the person.
- Then at the same time, the animal and the person should dart
20 meters away in 1 sec.
- Write a function called personToMyRight that has three object
parameters
called person1, person2, and person3.
This function assumes that the three persons are standing beside each
other, all facing the same direction.
Your function should assume that there is at least one person to person1's
right. Your function should return the closest person to person1's right.