//Visual Basic 2010 Recursie Procedures en Functies public class Exercise5Solution { void Main() { int diskCount = 5; int source = 1; int help = 2; int destination = 3; this.TowersOfHanoi(diskCount, source, destination, help); Console.ReadLine(); } void TowersOfHanoi(int diskCount, int source, int destination, int help) { if ((diskCount == 1)) { Console.WriteLine(((("from " + source) + " to ") + destination)); } else { this.TowersOfHanoi((diskCount - 1), source, help, destination); Console.WriteLine(((("from " + source) + " to ") + destination)); this.TowersOfHanoi((diskCount - 1), help, destination, source); } } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.