setup=_=>{createCanvas(400,400);o=_=>Array.from({length:40},_=>Array.from({length:40},_=>Math.round(random()))),n=o(),m=o(),f=40,frameRate(30)},draw=_=>{m.forEach((e,x)=>{e.forEach((e,y)=>{fill(e*255),square(x*10,y*10,10)})});for(x=0;x<f;x++){for(y=0;y<f;y++){s=0;for(u=-1;u<=1;u++){for(v=-1;v<=1;v++){s+=(u==0&&v==0)?0:m[(x+u+f)%f][(y+v+f)%f]}}n[x][y]=(m[x][y]+s==3||s==3)?1:0}}m=n,n=o()}
// #トゥートProcessing
//https://editor.p5js.org/atesaki/sketches/aFnK2rTC-
//ライフゲームだっ!