Skip to content

Instantly share code, notes, and snippets.

@DavidBuchanan314
Last active December 4, 2016 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidBuchanan314/0a820e258df0ddfb3fa244d9e7695c6d to your computer and use it in GitHub Desktop.
Save DavidBuchanan314/0a820e258df0ddfb3fa244d9e7695c6d to your computer and use it in GitHub Desktop.
gcc gol.c -Ofast && ./a.out | mpv -
#define F for(i=0;i<l*2;i++)
#define W;write(1,// David B
main(n){int i,j,w=640,h=480,
l=w*h,o[]={-w-1,-w,-w+1,-1,1
,w-1,w,w+1};char b[l*3];F b[
i]=rand()W"YUV4MPEG2 W640 H"
"480 F60:1 C444\n",31);for(W
"FRAME\n",6)W b,l*3)){F{for(
n=j=0;j<8;n+=b[(i+l+o[j++])%
l]&1);b[i+l]=(n^3&&!b[i]|n^2
)-1;}F b[i]=b[i+l];}}// 2016
@DavidBuchanan314
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment