Jump to content

Towers of Hanoi: Difference between revisions

no edit summary
No edit summary
Line 2,398:
 
move(4, 1, 2, 3)</lang>
=={{header|M2000 Interpreter}}==
{{trans|FreeBasic}}
<lang M2000 Interpreter>
Module Hanoi {
Rem HANOI TOWERS
Print "Three disks" : Print
move(3, 1, 2, 3 )
Print
Print "Four disks" : Print
move(4, 1, 2, 3)
Sub move(n, from, to, via)
If n <=0 Then Exit Sub
move(n - 1, from, via, to)
Print "Move disk"; n; " from pole"; from; " to pole"; to
move(n - 1, via, to, from)
End Sub
}
Hanoi
</lang>
{{out}}
same as in FreeBasic
 
=={{header|Maple}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.