The Tower of Hanoi is a classic mathematical game. It consists of three rods (ie. our version may consist of three to four rods) and a few discs of different sizes which can be moved onto any rod. The puzzle starts with the discs in a stack in ascending order of size on one rod, the smallest at the top and the largest at the bottom, thus making a conical shape. The goal is to move the entire stack to another rod, obeying the following rules:
1. Only one top most disc can be moved at a time.
2. Each move consists of taking the top most disc from one of the stacks and placing it on top of another stack.
3. No larger disc may be placed on top of a smaller disc.
With N discs, the puzzle can be solved in no more than 2^N - 1 moves.
</div> <div class="id-app-translated-desc" style="display:none">河内塔是一个经典的数学游戏。它由三个杆(即我们的版本可能包括三到四个棒)和不同尺寸的几个盘,可移动到任何杆。拼图开始在堆叠盘升序对一个杆,最小的在顶部和最大底部订单大小,从而使圆锥形。我们的目标是在整个堆栈移动到另一个杆,遵守以下规则:
1,只有一个最顶层的圆盘可以一次移动。
二,各移动由从堆栈中的一个取最上面的光盘,并把它放在另一个栈的顶部。
3,没有大的光盘可放置在一个较小的圆盘的顶部。
用N盘,拼图可以解决在不超过2 ^ n - 1个动作。</div> <div class="show-more-end">