
Max's Sorting Machine
Same list, five recipes, very different amounts of work
race five sorting algorithms on the same pile of bars, then try to beat them
what this teaches: sorting algorithms, algorithms as recipes, counting steps, why some code is faster
What you'll learn
- That an algorithm is just a recipe followed over and over, not magic
- That a computer can only compare two things at a time
- Why some recipes need hundreds more steps than others for the same job
- That the best algorithm depends on what the list already looks like
- How programmers measure work by counting compares instead of seconds
How to play
- Pick an algorithm, slow the speed right down, and watch one step at a time.
- Read the recipe on the right — the line it is on lights up as it works.
- Switch to Race them, put two algorithms on the same list, and pick a winner.
- Try You sort it, and see if you can beat the machine's swap count.
FAQ
What age is this for?
Around 8 and up, roughly 3rd through 8th grade. Younger children enjoy the race and the you-sort-it puzzle long before the word algorithm means anything to them.
Do I need to know how to code?
No. There is no code on screen at all — each algorithm is written out as four plain-English steps, and you watch the bars follow them.
Are these the real algorithms?
Yes. Bubble, selection, insertion, merge and quick sort are all really running, one operation at a time, and the counters show exactly how many compares and moves each one used.
For parents and teachers
The moment worth waiting for is the race: bubble sort against quick sort on forty bars, where quick sort finishes while bubble sort is still in its first third. That gap is the whole reason computer scientists care which algorithm you choose, and a child who has watched it once never needs the idea explained again. Pairs well with sorting a real deck of cards by hand afterwards.
Who Eats Whom
Hide and Seek
Max's Snap Lab