Code Lab
Learn to program from zero to advanced — pick a language and your level, then step through code, run it live, and work through guided lessons.
9 tools available
The Code Lab is the learn-to-program part of the site. It is built around a simple idea: you learn code faster by watching it run, predicting what it will do, and then fixing it, than by reading about it. The tools here let you do all three in the browser without installing anything.
The Code Execution Visualizer steps through a program one line at a time and shows the variables and the call stack as they change, which makes recursion and loops far less mysterious. The JavaScript Coding Lessons are auto-graded exercises, including fix-the-bug and predict-the-output problems, so you get an immediate answer on whether your reasoning was right. The Code Inspector and the explain-code tool read pasted code and describe what it does, detect the language, and estimate its time complexity.
Algorithm tools turn abstract ideas into pictures. The Sorting Algorithm Visualizer animates bubble, insertion, selection, merge, quick and heap sort, and the Big-O Complexity Chart shows how running time grows with input size. The difference is dramatic: for 1,000 items, an O(n) pass takes about 1,000 steps, an O(n log n) sort about 1,000 × 10 = 10,000, and an O(n²) sort about 1,000,000. Searching a sorted list of 1,000 items with binary search takes at most 10 comparisons, because each step halves the range and 210 = 1,024. The BST Visualizer shows why tree shape matters: a balanced binary search tree of 1,000 nodes is about 10 levels deep, but one built from already-sorted input degenerates into a chain 1,000 deep.
A good way to use the lab is to start with a lesson, run your solution through the visualizer when it fails, and check complexity with the inspector once it works. The G-code simulator applies the same read-and-trace habit to CNC programs.