Towers of Hanoi: Difference between revisions

(→‎{{header|PureBasic}}: Added PureBasic)
Line 785:
 
hanoi(4, "left", "middle", "right");</lang>
 
=={{header|PL/I}}==
<lang PL/I>
/* From Rosetta Fortran */
tower: proc options (main);
 
call Move (4,1,2,3);
 
Move: procedure (ndiscs, from, to, via) recursive;
declare (ndiscs, from, to, via) fixed binary;
 
if ndiscs = 1 then
put skip edit ('Move disc from pole ', trim(from), ' to pole ',
trim(to) ) (a);
else
do;
call Move (ndiscs-1, from, via, to);
call Move (1, from, to, via);
call Move (ndiscs-1, via, to, from);
end;
end Move;
 
end tower;
</lang>
 
=={{header|PureBasic}}==
Anonymous user