'Visual Basic 2010 Recursie Procedures en Functies Module Exercise5Solution Sub Main() Dim diskCount As Integer = 5 Dim source As Integer = 1 Dim help As Integer = 2 Dim destination As Integer = 3 ' TowersOfHanoi(diskCount, source, destination, help) ' Console.ReadLine() End Sub Sub TowersOfHanoi(ByVal diskCount As Integer, _ ByVal source As Integer, ByVal destination As Integer, _ ByVal help As Integer) If diskCount = 1 Then Console.WriteLine("from " & source & " to " & destination) Else TowersOfHanoi(diskCount - 1, source, help, destination) Console.WriteLine("from " & source & " to " & destination) TowersOfHanoi(diskCount - 1, help, destination, source) End If End Sub End Module 'Bezoek www.vbvoorbeelden.be voor meer Visual Basic voorbeelden. 'Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.