Towers of Hanoi

Work in harmony to achieve your goal

This animation uses the <canvas> element and may not run in older versions of Internet Explorer.


Some Android (eg default) browsers can't render the site properly. We'll let you know if they fix the problem (41312). Or try another browser, eg Firefox.

Example showing interleaved sequencing of moves.

The top four discs start to move. Once disc 5 is exposed and there is a free peg, it can move (but does not have to). Disc 1 moves on top of disc 5 but moves off before disc 5 needs to move. Disc 6 also moves before the top four discs are consolidated.

The reassembly sequence again shows disc 1 moving onto disc 5; again it moves off before disc 5 needs to move. This time disc 1 moves off disc 2 before disc 3 moves onto peg 1 - this is possible because disc 3 needs no additional free pegs to complete its move.