xref: /csrg-svn/usr.bin/m4/TEST/hanoi.m4 (revision 47964)
138814Sbostic#
238814Sbostic# Copyright (c) 1989 The Regents of the University of California.
338814Sbostic# All rights reserved.
438814Sbostic#
538814Sbostic# This code is derived from software contributed to Berkeley by
638814Sbostic# Ozan Yigit.
738814Sbostic#
8*47964Sbostic# %sccs.include.redist.sh%
938814Sbostic#
10*47964Sbostic#	@(#)hanoi.m4	5.2 (Berkeley) 04/12/91
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