VB.net Source Code

' Author: Hannes du Plooy 
' Date: 20 Sep 2016       
' Objective: To solve the towers of hanoi with number of discs provided in the arguments to calling the program 

Module Hanoi

    Sub Hanoi(source,dest,other,discs As Integer)
        if (discs > 0) then
            Hanoi(source,other,dest,discs-1)
            Console.WriteLine("Move " & source & " to " & dest)
            Hanoi(other,dest,source,discs-1)
        end if
    End Sub
    
    Sub Main()
        Dim arguments As String() = Environment.GetCommandLineArgs()
        if arguments.Length < 2 then
            Console.WriteLine("Please provide number of discs!")
        else
            Hanoi(0,2,1,Integer.Parse(arguments(1)))
        end if
    End Sub

End Module