Two programs from the UC Irvine Arcturus project try to move a knight to every square of the board exactly once. The left one searches by brute force and backs up when it gets stuck. The right one uses Warnsdorff's rule: always jump to the square with the fewest ways out. Both are line-for-line ports of the original Ada.
Click any square to start there. You'll get very different runs depending on the square you choose: on 8 × 8 the brute force finishes from the corner in about 29 million steps (almost 3 days at 120 steps a second), but from the square just below the corner it still hadn't finished after 300 million (about 29 days at 120 a second). At full speed the brute force does as many steps as it can, while Warnsdorff simply finishes.
Stephen Willson's Ada translation of an Applesoft Basic program, 1981–82
original/ada/t/orig_knightsFrank Tadman's rewrite of the search. The thesis benchmark.
original/ada/t/knightsThe small tags show each square the knight could jump to next, and how many ways out it would have from there. The yellow tag is the one it picks: the fewest, and the first in move order on a tie.
The program began as Applesoft Basic in a trade journal. Stephen Willson translated it to Ada (the left board). Frank Tadman changed it to use Warnsdorff's rule (the right board). That version became the benchmark in Stephen's 1983–84 thesis draft on the Arcturus interactive Ada environment. It was also translated to C and Pascal, and all four versions agree tour for tour.
These are JavaScript ports, step for step. They were checked against the originals: from row 2, column 1 the 1981 search makes exactly 47,448 steps on 4 × 4 and 32,049,396 on 5 × 5, as the original did under Arcturus 1.6-A. The Warnsdorff tours match the 1984 program on every start square from 4 × 4 to 8 × 8.
Going to the most cramped square first sounds backwards. But a square with one way out is a dead end waiting to happen. Visit it now, while you still can, and leave the open squares for later. The search never has to back up. On a 5 × 5 board from the corner it makes 24 moves and is done.
The brute-force search has no such sense. From the same corner, even with the 1981 bugs fixed, it takes 252 steps on 5 × 5, about 48,600 on 6 × 6, and about 29 million on 8 × 8. Arcturus ran it at roughly 86,000 steps a second on our 2026 test machine, so the 1981 version's hopeless 5 × 5 search from its fixed start on row 2, column 1 (32,049,396 steps) took six minutes there.