← Back to Age 9
Age 9 • Lesson 4 • Variables + Planning

Robot Resource Mission

Program the robot to collect 3 crystals and return to base. Every move uses energy. Batteries restore energy. Plan carefully.

🤖 Mission Map

Energy: 10
Crystals: 0/3
Moves: 0
⬜ Collect 3 crystals
⬜ Keep energy above 0
⬜ Return to base
Add commands, then press Run Mission.
🏅 Badge earned: Resource Planner!

🧩 Build Robot Program

Coding concept: A variable stores a value that can change. In this mission, energy, crystals, and moves are variables.

energy = energy - 1 after every move
crystals = crystals + 1 when robot collects crystal
energy = energy + 4 when robot collects battery

A good coder does not only find a path. A good coder checks resources too.