Library Programming, algorithms, and theory simulations →

Make computer science visible.

Interactive, step-by-step simulations for computer science — programming constructs, algorithms, and theoretical ideas — so students can see how concepts work, one step at a time.

Free for classrooms No install — runs in any browser Step-by-step explanations Classroom ready
Library

Simulations

Each simulation focuses on one idea — in code or in theory — and lets you control the pace.

No simulations match . Try another word or clear the search.
forcounted
whileuntil
LiveProgrammingBeginner

Loop Lab: for vs while

Step both loops side by side — see when a counted for fits, and when a condition-driven while is better.

Loops · for · whileOpen →
a
10
⇄
b
5
LiveProgrammingBeginner

Swapping two variables

Watch values copy between memory boxes as a temp-variable swap runs line by line — and see why the naive approach loses data.

Variables · AssignmentOpen →
3817
total11
LiveProgrammingBeginner

Totalling an array

Keep a running total in a labeled box while a for loop adds each array element.

Loops · AccumulatorsOpen →
38313
3
LiveProgrammingBeginner

Counting occurrences

Scan the list and watch the count box increase every time the target appears.

Loops · CountersOpen →
max9
min2
LiveProgrammingBeginner

Finding max & min

Track the largest and smallest values seen so far in labeled boxes as the loop runs.

Loops · ComparisonsOpen →
382
LiveProgrammingBeginner

Printing a 2D array

Visit cells of a grid — whole matrix, one row, or one column — and watch values print in order.

2D arrays · Nested loopsOpen →
382
total13
LiveProgrammingBeginner

Totalling a 2D array

Sum the whole grid, or build a list of totals — one per row, or one per column.

2D arrays · AccumulatorsOpen →
252
2
LiveProgrammingBeginner

Counting in a 2D array

Count a target across the whole grid, or build a list of counts — one per row, or one per column.

2D arrays · CountersOpen →
max9
min1
LiveProgrammingBeginner

Max & min in a 2D array

Find extremes across the whole grid, or build max/min lists — one pair per row, or per column.

2D arrays · ComparisonsOpen →
38174
LiveAlgorithmsBeginner

Linear search

Scan left to right and compare each element until the target is found — or the list ends.

Arrays · SearchOpen →
namesAdaChenEve
marks889590
LiveProgrammingBeginner

Parallel arrays

Keep related lists aligned by index — linear search a name, then read the mark at the same position.

Arrays · Linear searchOpen →
258132134
LiveAlgorithmsBeginner+

Binary search

Halve the search space each step and watch low, mid and high pointers converge.

Arrays · SearchOpen →
LiveAlgorithmsBeginner

Bubble sort

Compare neighbours, swap, and stop early with a swapped flag when a pass changes nothing.

SortingOpen →
LiveAlgorithmsBeginner

Selection sort

Find the minimum of the unsorted region each pass and swap it into place on the left.

SortingOpen →
3781··
LiveData structuresBeginner

Static arrays

Fixed capacity block — insert and delete by shifting neighbours. When full, insert is refused.

Contiguous · Fixed sizeOpen →
38157···
LiveData structuresBeginner+

Dynamic arrays

Same contiguous block — when full, allocate a larger block, copy values over, then keep inserting.

Resizable · Allocate + copyOpen →
381
LiveData structuresBeginner

Stacks

Push and pop values, then watch call stack frames push and pop as nested functions run.

LIFO · Call stackOpen →
fact(0) → 1fact(1)fact(3)
LiveProgrammingBeginner

Recursive factorial

Watch factorial(n) push frames onto the call stack, hit the base case, then unwind with return values.

Recursion · Call stackOpen →
fib(4)
fib(3)fib(2)
fib(2)fib(1)fib(1)fib(0)
LiveProgrammingBeginner

Recursive Fibonacci

Grow the fib(n) call tree and spot the same subproblems computed again and again.

Recursion · Call treeOpen →
381→
LiveData structuresBeginner

Queues

Enqueue at the back, dequeue from the front — first in, first out, like a waiting line.

FIFOOpen →
3→8→1↻
LiveData structuresBeginner+

Linked lists

Compare singly, doubly, and circular lists — then search, insert, and remove nodes.

Singly · Doubly · CircularOpen →
8
310
1614
LiveData structuresIntermediate

Binary search trees

Insert, search, and delete nodes, then walk the tree with inorder, preorder, and postorder traversals.

BST · Search · TraversalsOpen →
3815
LiveData structuresBeginner+

Sets

Unordered unique elements — membership, add/remove, union, intersection, difference, and subsets.

ADT · Uniqueness · AlgebraOpen →
0apple
2a → f
4pear
LiveData structuresIntermediate

Hash tables

Hash keys into buckets, resolve collisions with chaining, and watch the load factor — the engine behind dict and set.

Hashing · Collisions · Load factorOpen →
MCU
LiveTheoryBeginner

Infrared door sensor

Watch distance readings stream from an IR sensor to a microprocessor that opens the door within 1 m.

Sensors · ControlOpen →
PCIRACC MARMDRALU
LiveTheoryBeginner

Fetch–execute cycle

Step through fetch and execute while PC, IR, MAR, MDR, CU, accumulator, ALU, and RAM light up.

Architecture · CPUOpen →
YouBrowser DNSServer
LiveTheoryBeginner

How a page is fetched

Type a URL, ask DNS for an IP address, request files from the web server, then watch the browser render the page.

Internet · DNS · HTTPOpen →
Client lock Server
LiveTheoryIntermediate

How HTTPS works

Check a digital certificate, then watch the order stay locked while it crosses the network.

Certificates · EncryptionOpen →
IRQCPU StackISR
LiveTheoryBeginner+

Interrupt handling

See how priority and the interrupt queue let the processor keep running for a printer, then handle a keyboard.

Architecture · Priority · ISROpen →
LiveTheoryBeginner+

How sound is sampled

Compare a smooth wave with sample rectangles. Change the sampling frequency and bit depth, then play the stored sound.

Analogue · Digital · PCMOpen →
AAA→3A BB→2B
LiveTheoryIntermediate

Run-length encoding

Turn repeated letters, and flat rows of a picture, into a count and a symbol.

Compression · Text · PicturesOpen →
LiveArtificial intelligenceIntermediate

Two-layer network

Follow a forward pass and backpropagation, then watch the error curve fall as the weights change.

Networks · Pass or failOpen →
LiveArtificial intelligenceHL · Intermediate+

Convolutional neural network

See a digit travel through CNN layers to scores 0–9. Hover a layer, such as convolution, for the step in detail.

CNN · Layers · MNISTOpen →
LiveArtificial intelligenceIntermediate

Clustering

Group students by quiz and project scores, with no pass or fail label to learn from.

Unsupervised · GroupsOpen →
Hall0 out of 3 Yard1 out of 3 GateBest · 4/5
LiveArtificial intelligenceIntermediate

Learning a route

A robot tries three routes and learns which one is on time most often.

Reinforcement · ChoicesOpen →
LiveArtificial intelligenceIntermediate

Fit a line to house prices

Fit a straight line to six house prices, then compare your line with the best-fit line.

Supervised · Least squaresOpen →
LiveArtificial intelligenceIntermediate

Classify the new student

Predict whether Ari passes from the labelled students who are nearest on quiz and project scores.

Supervised · k-nearest neighboursOpen →
LiveArtificial intelligenceAdvanced

Turn practice into a pass probability

Turn practice questions into a probability of passing, then move the threshold that makes the decision.

Supervised · Logistic regressionOpen →

Our approach

Built for understanding, not memorising

Whether the topic is a loop in Python or a machine in automata theory, fuzzy mental models get clearer when you can watch the idea unfold.

Step at your own pace

Advance one step at a time, step back, or press play. The active step is always highlighted so you never lose your place.

See state change

Variables, arrays, stacks — and later automata, gates, and other models — are drawn as labeled boxes that update as each step runs.

Plain-language explanations

Every step comes with a short explanation of what happened and why — including the traps students commonly hit.

For students

Build intuition before the exam — or the code

  • Replay any step as many times as you need
  • See how variables, structures, and models change
  • Keyboard shortcuts for fast stepping
For teachers

Project it, share a link, done

  • No accounts, installs or plugins — just a URL
  • Each simulation is a single page that works offline
  • Designed to be readable on a classroom projector