source: trunk/essentials/sys-devel/m4/examples/trace.m4

Last change on this file was 3090, checked in by bird, 18 years ago

m4 1.4.8

File size: 524 bytes
Line 
1divert(-1)
2
3# move(from, to)
4define(`move', `Move one disk from `$1' to `$2'.
5')
6
7# _hanoi (cnt, from, to, aux)
8define(`_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)')')
10
11# hanoi (cnt)
12define(`hanoi', `_hanoi(`$1', source, destination, auxilliary)')
13divert`'dnl
14
15# Debugmode t
16debugmode(`t')
17hanoi(2)
18
19# Debugmode taeq
20debugmode(`taeq')
21hanoi(2)
22
23# Debugmode OFF
24debugmode
25hanoi(2)
26
27# Debugmode ae
28debugmode(`ae')
29traceon(`move', `_hanoi')
30hanoi(2)
Note: See TracBrowser for help on using the repository browser.