palindrome
Robbert van Renesse
cogito at tjalk.cs.vu.nl
Tue Dec 30 07:59:58 AEST 1986
Here follows a PORSROP (say it out loud), that is, a
PORtable Self-Reproducing Obfuscated Palindrome+
===============================================
Features:
produces itself as output
reversible
short++
Author:
Robbert van Renesse
Dept. of Maths and Computer Science
Vrije Universiteit
Amsterdam
The Netherlands
------------
+) This research was supported in part by the Netherlands Foundation for
the Advancement of Pure Research under grant 125-30-10, in an effort
to develop a Dutch SDI system. It will reproduce missiles sent to the
Netherlands and reverse the original direction (whatever that was).
++) Since this is a Dutch project the program must be short, to save on the
number of bytes (each byte is more disk space, thus more money).
--------8<----------------8<----------------8<----------------8<--------
/*X enifed#
};)b-f,b,1(etirw;)01(a,)p*(l);p++*;m=p(rof;)01(a,)44(a,)
43(a,)++p*(l,)43(a);p*;1+f=b(rof{)(niam};)++s*(a)s*(elihw{
;s*rahc)s(l};c=b--* =++f*{)c(a;b*,994+d=f*,]999[d,m=p**,}0
,"/*X enifed#"
,"};)b-f,b,1(etirw;)01(a,)p*(l);p++*;m=p(rof;)01(a,)44(a,)"
,"43(a,)++p*(l,)43(a);p*;1+f=b(rof{)(niam};)++s*(a)s*(elihw{"
,";s*rahc)s(l};c=b--* =++f*{)c(a;b*,994+d=f*,]999[d,m=p**,}0"
,"*/char*m[]={"{=][m*rahc/*",
"0},**p=m,d[999],*f=d+499,*b;a(c){*f++= *--b=c;}l(s)char*s;",
"{while(*s)a(*s++);}main(){for(b=f+1;*p;)a(34),l(*p++),a(34",
"),a(44),a(10);for(p=m;*++p;)l(*p),a(10);write(1,b,f-b);}",
"#define X*/",
0},**p=m,d[999],*f=d+499,*b;a(c){*f++= *--b=c;}l(s)char*s;
{while(*s)a(*s++);}main(){for(b=f+1;*p;)a(34),l(*p++),a(34
),a(44),a(10);for(p=m;*++p;)l(*p),a(10);write(1,b,f-b);}
#define X*/
--------8<----------------8<----------------8<----------------8<--------
Who's going to make the shortest one? For a start, the above program
can be made as small as 10 lines instead of 18, by eliminating some
newlines, saving 12 characters.
Have fun in 1987.
More information about the Comp.lang.c
mailing list