Towers of Hanoi: Difference between revisions
Content added Content deleted
m (→pictorial moves: corrected over compensation in the computation (when linesize is even) of the position of the third tower (for the down arrow).) |
|||
Line 175: | Line 175: | ||
move(4, 1,2,3) |
move(4, 1,2,3) |
||
)</lang> |
)</lang> |
||
Disk number is also printed in this code (works with a68g): |
|||
PROC move = (INT n, from, to, via) VOID: |
|||
IF n > 0 THEN |
|||
move(n - 1, from, via, to); |
|||
printf(($"Move disk "g" from pole "g" to pole "gl$, n, from, to)); |
|||
move(n - 1, via, to, from) |
|||
FI |
|||
; |
|||
main: ( |
|||
move(4, 1,2,3) |
|||
) |
|||
=={{header|ALGOL W}}== |
=={{header|ALGOL W}}== |