Sunday, 6 March 2011

grid world page 35

1
Why doesn’t CrabCritter override theprocessActors() method?  
They both use the same code, no need to duplicate.  
2
Describe the process a CrabCritter uses to find and eat other actors.

Does it always eat all neighboring actors?

Explain.  
It collects positions of actors left, right or ahead of it, and then implements the eat method. Unless it’s a rock/critter.
3
Why is the getLocationsInDirections()method used in CrabCritter?  
getActors() gets all available positions to move into 
4
If a CrabCritter has location (3, 4) and faces south, what are the possible locations for actors that are returned by a call to the getActors() method?  
4,3
4,4
4,5 
5
What are the similarities and differences between the movements of a CrabCritter and a Critter?  
Left or right? Not sure 
6
How does a CrabCritter determine when it turns instead of moving?  
It turns when it cannot move anywhere
7
Why don’t the CrabCritter objects eat each other?  
Critters eat other objects in the field. That is the basis no?


No comments:

Post a Comment