Towers of Hanoi: Difference between revisions

Content added Content deleted
(→‎{{header|AppleScript}}: lang tag ++ amigae)
Line 46: Line 46:
move(4, 1,2,3)
move(4, 1,2,3)
)
)

=={{header|AmigaE}}==
<lang amigae>PROC move(n, from, to, via)
IF n > 0
move(n-1, from, via, to)
WriteF('Move disk from pole \d to pole \d\n', from, to)
move(n-1, via, to, from)
ENDIF
ENDPROC

PROC main()
move(4, 1,2,3)
ENDPROC</lang>


=={{header|AppleScript}}==
=={{header|AppleScript}}==
global moves --this is so the handler 'hanoi' can see the 'moves' variable
<lang applescript> global moves --this is so the handler 'hanoi' can see the 'moves' variable
set moves to ""
set moves to ""
hanoi(4, "peg A", "peg C", "peg B")
hanoi(4, "peg A", "peg C", "peg B")
Line 59: Line 72:
end if
end if
return moves
return moves
end hanoi
end hanoi</lang>


=={{header|AWK}}==
=={{header|AWK}}==