AP CSA FRQ Guide
2014 FRQ 2: Director
Write a legacy GridWorld actor that alternates color and, on one color state, turns neighboring actors before acting.
Skills Tested
What this FRQ is really practicing
Review these topics before attempting the problem.
Starter Approach
How to begin with your own plan
- 1Initialize the actor with the required starting color.
- 2When acting from the active color state, rotate neighboring actors.
- 3Alternate color each time act is called.
Attempt the problem before opening the solution.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Declares Director as the required GridWorld type.
This is a legacy GridWorld archive prompt.
Initializes the starting color.
Use the color named in the prompt.
Processes neighboring actors.
Use GridWorld neighbor-location or neighbor-actor helpers.
Turns affected actors 90 degrees right.
Add Location.RIGHT or 90 degrees to the direction.
Practice Links
