% The Towers Of Hanoi % Mozart % Copyright (C) 2003 Amit Singh. All Rights Reserved. % http://hanoi.kernelthread.com % % Last tested under Mozart/Oz version 1.2.5 % http://www.mozart-oz.org % declare DoHanoi F Hanoi M N T U in proc {DoHanoi N F U T} if N > 0 then {DoHanoi (N - 1) F T U} {Browse [F '-->' T]} {DoHanoi (N - 1) U F T} end end proc {Hanoi M} if M > 0 then {DoHanoi M 1 2 3} end end {Hanoi 3}