AP CSA FRQ Guide
2013 FRQ 3: GridWorldUtilities and JumpingCritter
Find empty locations in a grid and write a legacy critter that jumps to a random empty location or removes itself when none exists.
Skills Tested
What this FRQ is really practicing
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Part A: scan every valid grid location and collect empty ones.
- 2Part B: override the appropriate movement behavior to jump to a random empty location.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Creates and returns an ArrayList of empty locations.
Return an empty list, not null, when no locations are empty.
Traverses rows and columns in the grid.
Check each valid Location.
Checks whether each location is unoccupied.
Use grid.get(location) or equivalent GridWorld logic.
Chooses a random empty location for the jump.
Do not always choose the first empty location.
Practice Links
