/Tower-of-Hanoi

A game version of the classical Tower of Hanoi puzzle

Primary LanguageC

Tower of Hanoi

Description:

This is a simple puzzle game known as Tower of Hanoi. There are three rods and 6 pegs in the puzzle. The aim of this game is to move all the pegs(circular discs) from rod 1 to rod 3 in an ascending order from top to bottom.

####Rules:

  • You can only shift one peg at a time.
  • To shift a peg, enter the rod number 'from' where you want to shift the peg, and then enter the rod 'to' where you want to shift the peg.
  • You can place a small peg over a large peg but you can't place a large peg over a small peg
  • The minimum number of moves required to solve this puzzle is equal to (2^n - 1) where n = number of discs. Thus for 6 discs, its 2^6 - 1 = 63.

Technology:

This game is made using windows.h library on Code::Blocks IDE having GNU GCC compiler

Written By:

Shivam Shekhar
Email: shivam.shekhar.ece14@itbhu.ac.in