Jump to content

Towers of Hanoi: Difference between revisions

(autoit)
(→‎{{header|Ruby}}: ++ sather)
Line 939:
hanoi (n-1), via, to, from
end</lang>
 
=={{header|Sather}}==
{{trans|Fortran}}
<lang sather>class MAIN is
move(ndisks, from, to, via:INT) is
if ndisks = 1 then
#OUT + "Move disk from pole " + from + " to pole " + to + "\n";
else
move(ndisks-1, from, via, to);
move(1, from, to, via);
move(ndisks-1, via, to, from);
end;
end;
 
main is
move(4, 1, 2, 3);
end;
end;</lang>
 
=={{header|Scala}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.