Posts Tagged ‘OpenGL Graphics Hanoi 3D Simulation’

Hanoi Towers

23/08/2010 2 comments

Hanoi Towers is a game where the objective is to move all discs from tower A To tower C BUT there are two simple rules :

  1. you can’t place a disc over a smaller one
  2. you can only move one disc at a time!

The problem can be solved using a recursive algorithm..
Actually my college partner Hashem Al-Rifai and I programmed this simulation for our college algorithms project
We used C++,OpenGL and SFML ( what a mixture 🙂 )
The reason we used SFML is because it makes working with windows,input and sound much easier, it saves you the trouble you might run into when using only OpenGL :D…

You can check Wikipedia for more information and algorithms…
Here’s our application:

You can rotate the scene,add more discs
Press Tab for fast animation!
We added some cool mouse features! please read the console window for more details 🙂

You can add up to 18 dics 🙂 , you don’t wanna do that since it will take forever to solve! don’t you believe me? go ahead and try it 🙂

Hanoi Simulation Executable – SFML and OpenGL Required Dlls are included

Hanoi Simulation Source Code – SFML and OpenGL headers and libs are NOT included