Thompsons self duplicating program
jim at haring.UUCP
jim at haring.UUCP
Thu Aug 23 13:33:39 AEST 1984
> From: steiny at scc.UUCP
>
> ***
>
> This probably belongs in net.unix and not net.sources, I am
> sure we will find out, but ... This one is much shorter, Thomson must
> not read Byte:
>
> main(){char q='"',*s="\\main(){char q='%c',*s=%c%c%.54s%c%s%.33s%cn%c;printf(\
> s+1,q,q,*s,s,*s,s+87,s+54,*s,q);}\n";printf(s+1,q,q,*s,s,*s,s+87,s+54,*s,q);}
Somebody must not be reading the EUUG Newsletter either:
From EUUGN Vol 3. No. 4
extracted from 'Some Self-Reproducing Programs' by Theo de Ridder
....
....
selfcopy2.c
char p[]="char p[]=%c%s%c;%cmain(){printf(p,042,p,042,012,012);}%c";
main(){printf(p,042,p,042,012,012);}
....
....
So, have fun with this SOURCE code. As usual, any comments, bug-fixes,
improvements......
Jim McKie Centrum voor Wiskunde en Informatica, Amsterdam mcvax!jim
More information about the Comp.sources.unix
mailing list