Kragen's fourth C .signature puzzle

Last updated 1999-07-12.

Here's the program:

char b[2][10000],*s,*t=b,*d,*e=b+1,**p;main(int c,char**v){int n=atoi(v[1]);
strcpy(b,v[2]);while(n--){for(s=t,d=e;*s;s++){for(p=v+3;*p;p++)if(**p==*s){
strcpy(d,*p+2);d+=strlen(d);goto x;}*d++=*s;x:}s=t;t=e;e=s;*d++=0;}puts(t);}

Here I have a line-by-line explanation and how to run it. It works with another tiny program, although it can run and produce some interesting output on its own.

It should run in any environment that supports ANSI C, although it expects argv to be NULL-terminated.


Kragen's home page