Programming & Debugging
Build a Collector in blocks or code, inspect live sensor values and find the block that took the wrong branch.
- Build your first Collector in Balanced
Build a repeating block program that checks battery, then cargo, then collects. Low battery should take the recharge branch. When battery is adequate, a full Collector should recycle. The remaining case should collect.
- Write your first Collector loop in Harsh
Use the game’s Harsh syntax and start with a three-way decision. In the official example the Collector recharges when battery is low, recycles when full, and collects in the remaining case. Keep those decisions inside the repeating loop.
- Fix a red line in Harsh code
Read the red line’s number and suggested closest command. Savebot’s editor identifies an unknown word by name. Use the Workshop’s insert control to get the game’s current command rather than guessing Python library syntax.
- Use a breakpoint to stop at the problem block
Use a breakpoint on the block where you expect the robot to make the wrong decision. Run that robot and inspect the active block and its live condition when the debugger stops.
- Read the selected robot’s live sensor values
Run the program and inspect the value shown next to a condition block for the selected robot. Forgeur Games says the value is live while the program runs.
- Check a block program using its sentence
Read the sentence below the block bench. Savebot describes the current program there. Use the sentence to check the order and nesting of your blocks before a longer run.
- Collector skips recycling or keeps collecting
Check the battery decision first, then the full-cargo condition. A full Collector can still legitimately recharge if the low-battery branch comes first. If neither trigger is detected, inspect the selected robot’s live reading before moving blocks.
- Robot runs out of battery
Put the battery check before the robot starts another work trip, then watch whether it reaches the charger and resumes its job. If it turns back but runs out en route, compare a shorter route before changing the rest of its program.
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.