Task: Design and implement Tower of Hanoi Puzzle program using C# and Windows Presentation Foundation (WPF) template in Visual Studio 2012 or newer.
The Tower of Hanoi Puzzle involves a stack of n graduated disks and a set of three needles called A, B and C. The initial setup places the n disks on needle A. The task for the program is to move the disks one at a time from needle to needle until the process rebuilds the original stack, but on needle C. The challenge is the fact that at no time a larger disk can be placed on top of a smaller disk.
Requirements:
Your design and implementation should satisfy the following requirements:
1. When a player starts your program, three empty needles appear.
2. The player enters a number between 1 and 10 inclusive to set the number of disks. All disks are placed on the left needle in ascending order (the smallest at the top).
3. The player chooses a level (easy, medium or hard) then starts playing. A countdown timer appears showing the time left for playing.
4. The player can use computer mouse to move disks as follows:
a. Only one disk may be moved at a time.
b. Each move consists of taking the upper disk from one of the needles and sliding it onto another needle, on top of the other disks that may already be present on that needle.
c. No disk may be placed on top of a smaller disk.
5. If the player completes the puzzle before the timer ends, the player is asked to enter player name. Player name, playing time (in seconds) and puzzle level will be saved to a text file. If no player name is entered, ‘anonymous' will be saved instead. If the player plays the puzzle again and the new playing time is shorter than the saved time (with the same level), your program will update the saved time with the new time then saves it.
6. The text file contains a list of player names, times in seconds, and levels. No duplicate is found for player names (i.e., a player name appears only once in the list with a particular level. This means a player name can appear 3 times because there are 3 levels). The list is sorted by playing time in ascending order (the shortest time is at the top).
7. If the player wants to know his/her shortest time for a particular level saved in the text file, your program is able to show it and you have to use a search algorithm in lecture note to implement this request.