Name:
Anonymous
2014-01-14 2:37
Post your fastest game of life implementation (just to keep things even, 800x800 grid size with wraparound)
Will evaluate at the end of the week to see which is fastest.
Name:
Anonymous
2014-01-16 14:37
#include <string.h>
#define C(x, y) (z[q][(y)*72+(x)])
#define P(x, y) \
C(x-1,y-1)+C(x,y-1)+C(x+1,y-1)+C(x-1,y)+C(x+1,y)+C(x-1,y+1)+C(x,y+1)+C(x+1,y+1)
char z[2][1728],q=0;main(i,x,y,n){for(i=0;i<1728;++i)z[q][i]=rand()&1;do{memset(
z[q^1],0,1728);for(y=1;y<23;++y)for(x=1;x<71;++x){n=P(x,y);z[q^1][y*72+x]=(C(x,
y)&&(n==2||n==3))|(!C(x,y)&&n==3);}q^=1;for(y=0;y<24;++y){for(x=0;x<72; ++x)
putchar(C(x,y)[" o"]);putchar(10);}}while(getchar()!=-1);}