1 Replies - 9495 Views - Last Post: 23 April 2012 - 02:33 PM Rate Topic: -----

#1 robotunicorn69   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-April 12


Posted 23 April 2012 - 02:28 PM

Hi, I was looking through these problems that my friend had in her class because I'm trying to learn java for next year and I'd like to know the solution. Can anyone solve it? I want to try to take the AP Computer Science Exam next year. Everyone's telling me that I need to know it for the exam. THANKS!

In the assignment I need to be able to design a BattleCritter that will be placed into the “Grid” along with other predatory critters. A simulation may be run with all of these critters in the “Grid” to determine who will win the GridWorld “Battle Royale!” The requirements for predatory critter creation are summarized below:
1. The critter must inherit from Critter or a subclass of Critter.
2. The critter may only eat any type of Actor at a time, except another Critter.
3. If the critter eats three instances of a given type Actor, then it may multiply (add another instance of itself to the Grid).
4. The critter must follow some “rule” to eat or kill off other critters (look in the current row, current column, behind, etc). It may not be a “random” algorithm. Write your “rule” in the comments.
5. The critter(s) that inherits from Critter must NOT override the act method.
6. The critter(s) that inherits from Critter should override one or more of the “Big 5” methods called in the act method: getActors(), processActors(), getMoveLocations(), selectMoveLocation(), and makeMove().
7. All of the overridden “Big 5” methods must satisfy that method’s stated postconditions.
8. The new critter (java files and images) can be integrated into one standard working GridWorld program (i.e. no special modifications need to be made to a standard GridWorld program).
9. Save all files (including your runner) in a folder called YourLastNameBattleCritter.
10. Challenge: If you don’t eat another Actor in 3 steps, then you pass away (= euphemism for “die.”).

Is This A Good Question/Topic? 0
  • +


#2 modi123_1   User is online

  • Suitor #2
  • member icon

Reputation: 14045
  • View blog
  • Posts: 56,214
  • Joined: 12-June 08


Posted 23 April 2012 - 02:33 PM

Moving to the grid world section..


Can anyone solve it?

Sure.. plenty of people probably can.


I want to try to take the AP Computer Science Exam next year.

Yup and asking for the code to be done for you is definitely not the optimum route to go. Why don't you take a whack at it first?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1