kernelthread.com

Euler

The Towers of Hanoi as an Euler program.

# # The Towers Of Hanoi # Euler # Copyright (C) 1998 Amit Singh. All Rights Reserved. # http://hanoi.kernelthread.com # # *Untested* under the Linux port of Euler # function dohanoi(N, t, f, u) if N > 0 dohanoi(N-1, u, f, t); printf("move %g --> %g\n", f, t); dohanoi(N-1, t, u, f); endif; endfunction function hanoi(N) if N > 0 dohanoi(N, 3, 1, 2); endif; endfunction

Download

hanoi.eul