Workspace tour
The workspace is where every build happens: the daily contest, practice and the sandbox all use the same layout. There are three columns: the task and shop on the left, the two file editors in the middle, and the board with the console on the right.
The sidebar tabs
- Task — the objective: its statement, budget, time limit, and the extra seconds each dollar of parts costs you. At the bottom, The test checks lists exactly what the judge will verify. This tab only exists when a task is open.
- Shop — every part and kit, with its price, a one-line example of how to use it in
circuit.py, and an Add to circuit.py button that appends that line for you. The top of the tab shows your bill and a meter against the budget; if a build is over budget, Submit refuses it before it reaches the judge, so it costs no penalty. - Guide — the shortest possible reminder of how
circuit.pyand the Run buttons work, with links into these docs. This is the tab the sandbox opens on. - Results — the verdict of every Run tests and Submit, one line per check, and how many wrong submissions you have made.
The two editors
The middle column has two files, switched with the circuit.py and main.py tabs:
circuit.pybuys the parts and wires the board. It is built when you press Run, Run tests or Submit, and quietly a moment after you stop typing, so the board, the bill and the schematic keep up with your edits (errors only show on Run, Run tests or Submit). The board view and the bill follow the last build, and the small chip next to the tabs tells you when a build is running, how many parts are on the board, that you have edited since the last run, or thatcircuit.pyhas an error. A build error shows its message, the line incircuit.py, and the full traceback under the editor; a build error found on Submit is not sent to the judge and costs no penalty.main.pyis the program that runs when the board is powered. Nothing in it happens until you press Run.
Both files are saved in your browser for that task, so reloading the page, or closing it and coming back, does not lose your work.
The board
The right-hand panel is a live picture of circuit.py: the Pi, the parts, and the wires between them. It is deliberately read-only — the simulator lays the board out for you: the Pi sits at the bottom with its GPIO header along the top edge, parts wired to the Pi sit in a row just above the header pins they use, parts wired only to those parts go in the row above, a module or kit stays together, and wires run in straight horizontal and vertical lines. Use at= on a part to place it yourself. The ⤢ button fits the board to the panel, and ⚡ shows the current in the wires as little blue whirls travelling along them (see Seeing the current). The Board | Schematic switch above it shows the same circuit as a schematic diagram, with standard symbols (a zigzag resistor, an LED's triangle) and part names such as R1 and D1; Building it on a real Pi explains how to read it. The very first time you open a workspace, the board panel shows Python booting instead: the browser downloads about 13 MB once, with a progress bar, and keeps it cached afterwards. You can read the task and type while it loads. If something is wired wrong, the board or the build error will say so; overcurrent warnings appear over the board.
To place and wire parts by hand, or to probe the board with instruments, open the Lab tab (or Lab mode in the sandbox toolbar): Lab mode is the full simulator.
The console
Under the board is the console: everything main.py prints, plus its errors. If the program calls input(), the console waits for you — type a line and press Enter, and the program continues.
The buttons
In the toolbar, from left to right:
- Run / ■ Stop — powers the board on and runs
main.py, or ends the run. Parts you can press (buttons, switches, keys) still respond to clicks while running. - Run tests — only when a task is open. It runs the same judge the server uses, in your browser, against the task's checks, and reports in the Results tab: start Python, build, simulate (with a progress bar for the simulated seconds) and check. The next run's Python is started in the background, so a second run starts almost at once. It is safe to run as often as you like.
- Submit — only in the daily contest. It sends both files to the server's judge: the verdict is what counts for the day. It is disabled while a submission is judging, once you are accepted, after the clock runs out, and when the build is over budget.
- Export — downloads a zip to build it on a real Pi: your code, a wiring sheet with a shopping list, a schematic, setup steps and a picture of the board. See Building it on a real Pi.
- Share — in practice and the sandbox, posts the build to the community (sign-in required).
The header also shows the contest timer (the server's clock, not yours) and your current bill against the budget.
Going deeper
- Run tests is a rehearsal, Submit is the performance. They call the same judge with the same objective, so a build that passes the tests locally should be accepted on submit; the difference is that Submit is timed and counts. See submissions and verdicts.
- The timer belongs to the server. Practice and the sandbox have no timer; only a contest attempt does.
- Storage keys are per task: each attempt in the contest, each practice objective and each sandbox share stores its own pair of files. Opening someone's build from a post or a past leaderboard copies their files into a new sandbox, so your edits never change theirs.
- Lab mode is different in kind: there you edit the board itself, with the inspector, data feeds and instruments, instead of writing
circuit.py. See Lab mode.