'***************************************************************'
'* Die Türme von Hanoi Lizenz: GPL *'
'* *'
'* (c) 2002 Roland Illig <1illig@informatik.uni-hamburg.de> *'
'***************************************************************'
Sub bewege(a, b, c, n)
' Bewegt n Scheiben von Turm a nach Turm c und benutzt als Zwi-
' schenspeicher Turm b.
If n = 1 Then
Document.Writeln("Lege die oberste Scheibe von Turm " _
+ a + " auf Turm " + c + ".")
Else
bewege a, c, b, n-1
bewege a, b, c, 1
bewege b, a, c, n-1
End If
End Sub
bewege "a", "b", "c", 5
|