AP CSA FRQ Guide

2012 FRQ 2: RetroBug

Write a legacy bug that remembers the location and direction from its most recent act and can restore that state when possible.

Legacy GridWorld State Restoration22 minute targetGridWorldstateobjectslegacy

Skills Tested

What this FRQ is really practicing

GridWorldstateobjectslegacy

Treat these skills as the study checklist. If any tag feels shaky, review that topic before attempting the full written response.

Starter Approach

How to begin without copying a solution

  1. 1Save the previous location and direction at the start of each act.
  2. 2Call the superclass behavior after saving state.
  3. 3Restore direction and, when allowed, move back to the saved location.

Write a first attempt before revealing any solution outline. Most AP CSA FRQ progress comes from tracing your own code and finding the missing case.

Common Mistakes

Mistakes to watch for while writing

Saving state after the bug has already acted.
Allowing repeated restore calls to move farther back than one act.
Ignoring the occupancy rule for the previous location.

Self Check

Review questions before you submit

Declares RetroBug as a Bug.

This is a legacy GridWorld archive prompt.

Stores previous location and direction.

restore needs both pieces of state.

Uses normal Bug behavior after saving state.

The retro bug acts like a regular bug.

Checks whether the previous location can be occupied.

The prompt allows restoring only under certain occupancy conditions.

Practice Links

Where to go next