The tower of Hanoi is a mathematical game. It consists of three towers and a number of disks of different sizes which can slide onto any tower. The game starts with the disks neatly stacked in order of size on the tower, the smallest at the top thus making a conical shape. The objective of the game is to move the entire stack to another tower. But there are some rules, the rules are only one disk may be moved at a time and each move consists of taking the uppers disk from one of the pegs and sliding it onto another tower, on top of the other disks that may already be present on that tower and no disk may be placed on the top of a smaller disk.