# C, 328 <del>585</del> <del>611</del> <del>615</del> <del>623</del> <del>673</del> <del>707</del> bytes Source code: <!-- language-all: lang-c --> p[256][256]={0};char*X="p[256][256]={0};char*X=%c%s%c,Y[999],c,j,*a;main(){sprintf(Y,X,34,X,34);for(a=Y;*a;a++)p[*a][*(a+1)]++;j=*Y;while(c=j)for(putchar(c);;)if(rand()>>16<p[c][++j])break;}",Y[999],c,j,*a;main(){sprintf(Y,X,34,X,34);for(a=Y;*a;a++)p[*a][*(a+1)]++;j=*Y;while(c=j)for(putchar(c);;)if(rand()>>16<p[c][++j])break;} With newlines and whitespace added for legibility/explanation: 01 p[256][256]={0}; 02 char*X="p[256][256]={0};char*X=%c%s%c,Y[999],c,j,*a;main(){sprintf(Y,X,34,X,34);for(a=Y;*a;a++)p[*a][*(a+1)]++;j=*Y;while(c=j)for(putchar(c);;)if(rand()>>16<p[c][++j])break;}", 03 Y[999],c,j,*a; 04 main(){ 05 sprintf(Y,X,34,X,34); 06 for(a=Y;*a;a++) p[*a][*(a+1)]++; 07 j=*Y; 08 while(c=j) 09 for(putchar(c);;) 10 if(rand()>>16 < p[c][++j]) 11 break; 12 } The variable `p[][]` will contain the occurrences of each character following another. `X` contains the entire source, with `%c%s%c` instead of the assignment for X. The `%c` characters will be replaced with 64, the double quotation mark. Line `06` tallies the occurrences of one character following another and starts the Markov model at the first character of the program (`'p'`). The while loop from `08` to `11` first outputs the current state of the Markov model, then finds the next state. A state is chosen as the next transition if the next random number is less than the number of occurrences for that state. I was able to save bytes by using sprintf over my original string-copying. Increasing the constant `16` on line `10` can decrease the runtime, but it makes the results less random. Sample output: `p[++);ar()iforile()in(Y;)putfor(aind(c,X,*a+j=j,c][c,*an(arilear(prea+16])putc])>1)>16][c=%c,*X,j=*ak;f(Y;j)fora+j]=j][256<pre(a;a;f(r*ar(Y;fore()>>>16]++j][256<putc][256<putc={sp[256]){0};j],j);}",*X,j],Y[c);a++j,34,X,c%sputf(c)fora],X="p[*ain();c]+1)>>>>1)>1);;arile();f(Y;a;f()>16]={0};){0};wha;j=Y;marilea+1)ind(Y;;);whar(r(a=*ar(r(a+){sputf()>>16][*a]+j,j,X,X,c);j=%chaile(a;;}`