The objective of the Tower of Hanoi game is to move a given amount of disks from Tower 1 over to Tower 3. The challenge of the game is, that you cannot place a larger disk onto a smaller one.
This project is a solver for the Tower of Hanoi problem implemented in C#. The program uses two different approaches that the user can specify when running it:
- Recursive Approach
- Iterative Approach
- C#
- .NET 8.0 SDK for development and execution/compilation
To get started with the Tower of Hanoi Solver, follow the steps below to install and run the program.
Before running the program, ensure that you have the following installed:
-
Clone the repository or download the source code from here:
git clone https://github.com/frvnzz/TowerOfHanoi-Solver.git cd TowerOfHanoi-Solver -
Run the program using one of the following commands:
Recursive Approach:
dotnet run -Recursive <number_of_disks>, e.g.:dotnet run -Recursive 3
Iterative Approach:
dotnet run -Iterative <number_of_disks>, e.g.:dotnet run -Iterative 2
Distributed under the Unlicense License. See /docs/LICENSE.txt for more information.
Franz-Aurel Huber – cc231014@fhstp.ac.at
Tower of Hanoi Animation
/docs/Tower_Of_Hanoi.gif
Source: Wikimedia Commons, licensed under Creative Commons Attribution-Share Alike 3.0 Unported.
