Write a little program to drive a robot across the grid and light every beacon before its energy runs out.
Build a program from a palette of commands, move, turn, light, split between a MAIN sequence and one reusable procedure. Commands inside the procedure cost less energy than inline ones, so folding repeated moves into the procedure and calling it is how you squeeze under tight budgets. Run the program to light every beacon within the energy limit.
Beacon Bot teaches loops and reusable procedures through an energy-budget visual-programming puzzle, building core coding ideas.
Building a program from move, turn, light and split commands, divided between a MAIN sequence and one reusable procedure, teaches the subroutine — the idea that a named block of instructions can be written once and called from anywhere.
Restricting you to a single reusable procedure is the whole design. With unlimited ones the puzzle is easy; with exactly one you must find the pattern that actually repeats.
That is the real skill a subroutine demands. Naming a chunk of code is trivial, and choosing which chunk is the judgement — pick the wrong boundary and the procedure is used once and helps nothing.
Beacon Bot is an original visual programming puzzle that teaches loops and reusable procedures through an energy-budget challenge. Play free in your browser with daily and practice levels.