letbeings;letn;letdepth;letstepA;letholeR;letcnt;lett=0;functionsetup(){cnv=createCanvas(600,600);background(255);beings=[];n=int(random(24,180));depth=int(random(80,200));holeR=random(5,width/4);letdeltaD=(width-holeR-20)/depth;stepA=(2*PI)/n;cnt=0;for(leti=0;i<n;i++){for(letj=0;j<depth;j++){beings.push(newBeing(cnt,holeR+j*deltaD,(i%n)*stepA));cnt++;}}describe("circle of small arc strokes playing out a game of life with small strands of same teal color palette appearing as gossamer");strokeWeight(2);noFill();frameRate(3);}functiondraw(){t+=0.001;translate(width/2,height/2);background(255,255,255,100);rotate(t);for(leti=0;i<beings.length;i++){beings[i].assessThyself();beings[i].display();}}classBeing{constructor(id,r,theta){this.id=id;this.r=r;this.awakeCount=0;this.offset=random(-0.2,0.2);this.theta=theta+this.offset;this.c=[random(100,150),random(180,240),random(200,255),150];this.awake=random([true,false]);this.randomNeighbor=int(random());this.neighbors=[];this.nN=int(random(1,7));for(leti=0;i<this.nN;i++){this.neighbors.push(int(random(0,cnt-1)));}}display(){if(this.awake){stroke(this.c);}else{stroke(255,255,255,50);}arc(0,0,this.r,this.r,this.theta,this.theta+stepA/1.3);for(leti=0;i<this.neighbors.length;i++){push();stroke(this.c);strokeWeight(0.05);if(beings[this.neighbors[i]].awake&&this.awake){line((this.r/2)*cos(this.theta),(this.r/2)*sin(this.theta),(beings[this.neighbors[i]].r/2)*cos(beings[this.neighbors[i]].theta),(beings[this.neighbors[i]].r/2)*sin(beings[this.neighbors[i]].theta));}pop();}}assessThyself(){this.awakeCount=0;for(leti=0;i<this.neighbors.length;i++){if(beings[this.neighbors[i]].awake){this.awakeCount++;}}if(this.awakeCount>3){this.awake=!this.awake;}if(this.awakeCount===2&&this.awake){this.awake=false;}if(this.awakeCount===0&&!this.awake){this.awake=true;}}}functionmousePressed(){setup();draw();}