xref: /csrg-svn/usr.bin/m4/TEST/hanoi.m4 (revision 62077)
138814Sbostic#
2*62077Sbostic# Copyright (c) 1989, 1993
3*62077Sbostic#	The Regents of the University of California.  All rights reserved.
438814Sbostic#
538814Sbostic# This code is derived from software contributed to Berkeley by
638814Sbostic# Ozan Yigit.
738814Sbostic#
847964Sbostic# %sccs.include.redist.sh%
938814Sbostic#
10*62077Sbostic#	@(#)hanoi.m4	8.1 (Berkeley) 06/06/93
1138814Sbostic#
1238814Sbostic
1338814Sbosticdefine(hanoi, `trans(A, B, C, $1)')
1438814Sbostic
1538814Sbosticdefine(moved,`move disk from $1 to $2
1638814Sbostic')
1738814Sbostic
1838814Sbosticdefine(trans, `ifelse($4,1,`moved($1,$2)',
1938814Sbostic	`trans($1,$3,$2,DECR($4))moved($1,$2)trans($3,$2,$1,DECR($4))')')
20