Programming & Debugging

Build a Collector in blocks or code, inspect live sensor values and find the block that took the wrong branch.

Find the first place your program differs from what you expected

Choose a problem you can reproduce with one selected robot. For example, wait until a Collector is full while it has enough battery, then see whether the active line or block goes to recycling. If battery is low too, recharge is the first branch of the official sample. That comparison avoids treating a deliberate priority as a broken cargo check. Write down the observed state before changing the program so you can reproduce it afterward.

If a Harsh program shows a red line, resolve the shown error before testing branches. The editor can point to an unknown word and suggest a close command. Insert the game-provided action if it matches the job. If the line validates and is never reached during an otherwise suitable run, move to the decision that controls it. The earlier decision is where a breakpoint can tell you what is happening.

Select a tool that answers one specific question

Use the sentence under a block program to check what the layout says. Does the collecting action belong to the ordinary case or sit after the entire test? Use the live reading beside the relevant condition when you need to see what state the selected robot is acting on. Look for one change over time. A value from another robot with the same program cannot explain the selected robot's action.

Use a breakpoint when a state changes too quickly to inspect or you cannot tell which of two decisions ran first. If the breakpoint never fires, try the nearest earlier block that should run and follow the selected route. If the break occurs on a sensible condition and the intended action still fails, watch the result in the world. You can separate a problem in the program from a command that reached an unsuitable target.

Retest a boundary after a change

Make a small change with a prediction before resuming normal work. For example, if you moved the recycling action into the full-cargo branch, observe a full case, then observe what the robot does with space remaining. If the fix works in one case and breaks the other, both tests matter. Keep the version that can explain both outcomes before applying the program to other robots. Use the Balanced and Harsh Collector guides for their full setup, or the specific debugging guide when you already know which check you need.