Back to Library

Sorting race

Four sorting methods race on the same shuffled bars, with their real comparison counts.

By Troiana

Prompt

Make a 12 second data film, 1280x720, with no sound: four sorting algorithms racing each other.

The panels, in a 2x2 grid: bubble sort, insertion sort, merge sort, quicksort. Each one sorts the same shuffled list of 64 bars.

The film must be honest:
- Really run each algorithm once, up front, with a seeded shuffle. Record the array after every write and the running count of comparisons.
- All four use one clock: the same number of writes per second. Slower methods finish later because they really take more writes. Do not stretch any of them to fit.
- Each panel shows its name and its live comparison count. When a panel finishes, add its finishing place.
- Hold the finished state for the last 2 seconds so people can read the result.

Look: near-black background, white text. Colour each bar by its value along the full rainbow, so a sorted panel becomes a clean spectrum. The bars being written right now turn white for that frame.

Build it as one HTML file with a canvas and a seek(t) function that only looks up a recorded state, so any frame can be rendered on its own. Then render it with a headless browser at 30fps and encode with ffmpeg.
Type
Video
Model
Claude Opus 5.5
Tools
HTML canvas, Chrome, ffmpeg
Added
Nov 5, 2026

Made by Troiana.

More from the Library