Skip to content

Instantly share code, notes, and snippets.

@murilopolese
Created June 26, 2020 08:54
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 murilopolese/ab88712f3430710af02d88590ad87717 to your computer and use it in GitHub Desktop.
Save murilopolese/ab88712f3430710af02d88590ad87717 to your computer and use it in GitHub Desktop.
Tweetable game of life
m=[];l=999;for(i=0;i<99;i+=1){m[i]=1}setInterval(()=>{n=[];i=l;while(i--){s=!!m[i-1]+!!m[i+1]+!!m[i+49]+!!m[i+50]+!!m[i+51]+!!m[i-49]+!!m[i-50]+!!m[i-51];n[i]=(s==3)||!!(m[i]&&s==2)}t='';i=l;while(i--){t+=7-n[i]*7+(i%50?'':'\n')}d=document;if(d){d.body.innerText=t}m=n},99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment