Engineering Code Lab · JavaScript in your browser
Code that measures, filters and controls.
32 short programming problems pulled straight from engineering: average a sensor, debounce a button, find a root, tune a PID loop, fit a calibration line. Each has starter code, automated tests (some hidden), hints that unlock one at a time, and an explanation once you solve it.
How the sandbox keeps you safe
- runs in your browserNever on a server.
- no networkThe sandbox cannot fetch, post or open sockets.
- 3 s limitInfinite loops are stopped, not frozen.
- nothing uploadedDrafts stay in this browser.
Level 2: Builder
10 exercises also come as a buggy version to fix: guided debugging, the way real engineering often starts.
Levels describe what you can already do, not your age.
- △ L2 · Digital electronicsBinary ↔ decimal converterConvert between binary strings and numbers the way a microcontroller register works.place value and loops🐞 debug variant
- △ L2 · Motor controlPWM duty-cycle tableBuild a table of pulse on-times for a PWM signal and plot it.loops building arraysplots
- △ L2 · Embedded systemsSet, clear and test register bitsTurn individual bits of an 8-bit control register on and off without disturbing the others.bitwise operators🐞 debug variant
- △ L2 · CommunicationsCheck a sensor packetCompute an 8-bit checksum and reject corrupted radio packets.modular arithmetic
- △ L2 · Embedded systemsDebounce a noisy buttonClean up a bouncing push-button signal so one press counts as one press.state and counters🐞 debug variantplots
- △ L2 · RoboticsWheel speed from an encoderTurn encoder ticks counted over a time window into rpm and metres per second.unit conversion
How it works
- Write in the editor: Tab indents, Ctrl/⌘ + Enter runs.
- Run to see
console.logoutput, line charts fromplot(xs, ys, "label"), or a step-by-step sorting and searching visualiser. - Check to run the visible and hidden tests. Hidden tests show pass or fail, never the expected answer.
- Stuck? Hints unlock one at a time. Nothing is timed and nothing is ranked.