← Return to actual work

Towers of Hanoi

Live · single-player study
Music
SFX
Your best

The puzzle computer science students have been quietly resenting for decades, now available to resent on your lunch break too.

Towers of Hanoi was invented in 1883 by French mathematician Édouard Lucas, who packaged it as a toy puzzle but built it around a genuinely elegant piece of recursive logic — move a stack of discs from one peg to another, one at a time, never placing a larger disc on a smaller one. It's since become a staple of computer science education specifically because the optimal solution (2ⁿ − 1 moves for n discs) is one of the cleanest real-world examples of recursive thinking there is, which means most people's first encounter with it was a slightly resentful one in a first-year programming course. Outside the classroom it holds up as a pure logic puzzle: no luck, no clock pressure unless you want one, just the satisfaction of finding the shortest path.

How to play

Move the entire stack of discs from the first peg to the last, moving one disc at a time and never placing a larger disc on a smaller one. Choose your difficulty before starting.

Scoring

Scored on move efficiency — solving in fewer moves than the optimal solution isn't possible, but getting close to it scores best.

Why play this?

It looks like logic-puzzle homework, which means it's the single most defensible game on the site if questioned.

Questions

What's the difference between difficulties?

Easy, medium, and hard each use a different number of discs, with separate leaderboards for each.

What's the minimum number of moves?

The mathematical minimum is 2ⁿ − 1 moves for n discs — the game tracks how close you get.

More games