Thompsons self duplicating program

BALDWIN mike at whuxl.UUCP
Fri Aug 24 04:36:47 AEST 1984


Larry's (cbscc!lvc) version can be made two characters shorter by
removing the spaces:

main(){char*a="main(){char*a=%c%s%c;printf(a,34,a,34);}";printf(a,34,a,34);}

which is really the same thing as a 76-character version I posted
not long ago:

char*a="char*a=%c%s%c;main(){printf(a,34,a,34);}";main(){printf(a,34,a,34);}

Now if you're using a V6 C compiler, you can remove the two equal
signs as well!  This has >got< to be the shortest one!

							Michael Baldwin
							harpo!whuxl!mike



More information about the Comp.sources.unix mailing list