Conway’s Life in 387 bytes of C

$ cat life.c
main(){char z[2][24][80],*a,*b,*c,*d,*e;int q,p=-1,x,y,i,k;srand(time(0));while
(1){for(strcpy(d=z[b=e=z[q=p][22],a=b-80,c=z[p],p=!p][y=23]," life.c (c) 1999 \
kurtstephens.com \033[H");y--;c=b,b=a,a=y-1?a-80:e)for((d-=80)[x=79]=10;x--;)i
=x?x-1:78,k=x-78?x+1:0,d[x]=" *\n"[q<0?rand()>>8&1:(k=a[i]+a[x]+a[k]+b[i]+b[k]+
c[i]+c[x]+c[k])-276?!(k-286):b[x]/42];write(1,z+p,1878);sleep(1);}}

Leave a Reply

Your email address will not be published. Required fields are marked *

*