Write a C++ program which allows the user to play the game "Tower of Hanoi" with 8 disks. See https://en.wikipedia.org/wiki/Tower_of_Hanoi for rules of the game. We use the following conventions.

  • The game is played with 8 disks of different sizes and on 3 towers labeled 1, 2, 3.
  • At the start, all disks are on tower 1 (with the largest disk at the bottom).
  • If the user enters x, y, then the top disk of tower x is moved to the top of tower y.
  • The game is won if all disks are at tower 3.
  • The game is implemented in C++ using screen output to visualize the current state and keyboard input for moving the disks. If the user inputs an incorrect move, there should be an error message and he should be asked to repeat the input. When the game is won, there should be a corresponding message and the program should stop.

Here is an example of the screen output during a game: see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.