Oasis Cache Caravan
The caravan repeats the same long scouting trips! Build a memory cache so saved oasis maps can answer the next request instantly.
π§ Before we start
At the Lava Trail, your program remembered choices so it could go back. Today it will remember answers. A cache saves a useful result and reuses it when the same request returns.
Arrange the cache recipe
Tap four visual instruction blocks in the order a cache program uses them.
Serve four map requests
Check the cache first. On a miss, scout and save. On a hit, use the saved mapβno extra trip!
empty
empty
Refresh a stale map
A sandstorm moved the Palm Well marker. Old saved answers can become stale. Choose the safe cache action.
Debug the mixed-up key
Both maps were saved under one vague key. Pick a repair so each request finds its own answer.
π What you learned
- A cache stores answers that may be needed again.
- Programs check the cache before doing slow work.
- A cache miss means fetch the answer, then save it.
- A cache hit reuses a saved answer and avoids repeated work.
- Stale answers need refreshing, and unique keys stop mix-ups.