Towers of Hanoi: Difference between revisions

→‎{{header|Icon}} and {{header|Unicon}}: Creating example of newly-added language Imp77
(→‎{{header|Icon}} and {{header|Unicon}}: Creating example of newly-added language Imp77)
Line 3,408:
return
end</syntaxhighlight>
 
=={{header|Imp77}}==
<syntaxhighlight lang="Imp77">
%begin
%routine do hanoi(%integer n, f, t, u)
do hanoi(n - 1, f, u, t) %if n >= 2
print string("Move disk from ".itos(f,0)." to ".itos(t,0).to string(nl))
do hanoi(n - 1, u, t, f) %if n >= 2
%end
do hanoi(4, 1, 2, 3)
print string("Towers of Hanoi puzzle completed!".to string(nl))
%end %of %program
</syntaxhighlight>
 
=={{header|Inform 7}}==
3

edits