kernelthread.com

Mozart

The Towers of Hanoi as a Mozart program.

According to the Mozart/Oz website

The Mozart Programming System is an advanced development platform for intelligent, distributed applications. The system is the result of a decade of research in programming language design and implementation, constraint-based inference, distributed computing, and human-computer interfaces. As a result, Mozart is unequaled in expressive power and functionality. Mozart has an interactive incremental development environment and a production-quality implementation for Unix and Windows platforms. Mozart is the fruit of an ongoing research collaboration by the Mozart Consortium.

% 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}

Download

hanoi.moz