AP CSA FRQ Guide
2011 FRQ 2: AttractiveCritter
Write a legacy critter that attempts to move other actors one cell closer before moving like a normal critter.
Skills Tested
What this FRQ is really practicing
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Override the appropriate Critter processing method, not act.
- 2For each other actor, compute a location one step closer.
- 3Move an actor only if the destination is empty.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Declares AttractiveCritter as a Critter.
This is a legacy GridWorld archive prompt.
Overrides actor-processing behavior.
The prompt explicitly says not to override act.
Computes direction toward this critter.
Use the GridWorld direction helper named in the prompt.
Moves another actor only to an empty valid location.
Occupied destinations should leave the actor where it is.
Practice Links
