namespace TowerofHanoi { internal class Program { static void Main(string[] args) { Console.WriteLine("Please give the number of disks: "); int n = int.Parse(Console.ReadLine()); Hanoi(n, 'A', 'C', 'B'); } public static void Hanoi(int n, char R1, char R3, char R2) { if (n > 0) { Hanoi(n - 1, R1, R2, R3); Console.WriteLine("Move the disk {2} from tower {0} to {1}", R1, R3, n); Hanoi(n - 1, R2, R3, R1); } } } }