* doc/m4.texinfo (Undivert): Fix typo in last commit.
[m4.git] / examples / hanoi.m4
blobc4a80fc668d65d5a58466e20f0a8613390388357
1 divert(-1)
3 # move(from, to)
4 define(`move', `Move one disk from `$1' to `$2'.
5 ')
7 # _hanoi (cnt, from, to, aux)
8 define(`_hanoi', `ifelse(eval(`$1'<=1), 1, `move($2, $3)',
9 `_hanoi(decr($1), $2, $4, $3)move($2, $3)_hanoi(decr($1), $4, $3, $2)')')
11 # hanoi (cnt)
12 define(`hanoi', `_hanoi(`$1', source, destination, auxilliary)')
14 # traceon(`move', `_hanoi', `decr')
15 divert`'dnl