Total Engineering

Code Labbeta

ESENOther labsBack to site
Ready. Press Ctrl+Enter to run.

Programming is engineering too

Today hardly any engineer works without code: we program to automate calculations, read sensors, analyse plant data or test a controller before installing it. Here you can practise three widely used languages, each with its own speciality, without installing anything.

JavaScript

It is the language of the web: it runs in every browser and also on servers with Node.js. Engineers use it to build monitoring dashboards, machine interfaces (web HMIs) and calculators like the ones on this site. It is fast and perfect for seeing results instantly. Try console.table() to display data tables.

Python

It is the favourite for scientific computing, data analysis, automation and machine learning. Its syntax is clean and reads almost like pseudocode, which is why many universities teach it. At work it is used to process measurements, simulate systems and write scripts that save hours of spreadsheet work. Here you have the full standard library (math, statistics, random, itertools…).

SQL

It is not a general-purpose language: it is for asking a database questions. Almost every serious system stores its data in tables, from university grades to the readings of thousands of sensors in a plant. With JOIN you combine tables and with GROUP BY you summarize millions of rows into one answer. The practice database has students, courses, grades, sensors and temperature readings.

How does everything run in the browser?

Your code never leaves your device. JavaScript runs in a Web Worker, a separate thread that doesn’t freeze the page. Python works thanks to Pyodide, the official CPython interpreter compiled to WebAssembly; it downloads once (about 10 MB) and then stays cached. SQL uses sql.js, which is SQLite, the same engine phones use, also compiled to WebAssembly.

Infinite loops and limits

If your program doesn’t finish within the time limit, Code Lab stops the worker and creates a new one, just as a watchdog resets a hung microcontroller. Python has no internet access and no external packages such as numpy, and input() reads the lines you type in the input box before running.

Challenge of the day

Every day a new challenge appears from a bank of 36 engineering problems: unit conversions, Ohm’s law, sensors, digital signals, a PI controller and more. You solve it in JavaScript or Python, earn points depending on difficulty, attempts and time, and keep your streak of consecutive days. Open the Today tab to start.

Share and save

Your draft is saved only in this browser. The Share button creates a link with your code compressed into the address itself: whoever opens it sees exactly what you wrote, without it going through any server.