0xf4dc91a5…4d2esent to0xa7d8d9ef…d270·#15,336,792·view on Etherscan
<GTh*Mxx&&(Mcraft.fill(.4,130/255,56/255),Mcraft.rect(ix,iy,dtt)),H[dix][diyy]>GTh*Mxx&&H[dix][diyy]<GMTh*Mxx&&(Mcraft.fill(105/255,76/255,47/255),Mcraft.rect(ix,iy,dtt)),H[dix][diyy]>GMTh*Mxx&&H[dix][diyy]<Mxx&&(Mcraft.fill(90/255,90/255,86/255),Mcraft.rect(ix,iy,dtt)),H[dix][diyy]<=0&&(Mcraft.fill(7/255,37/255,107/255),Mcraft.rect(ix,iy,dtt));for(Mcraft.noStroke(),ix=0;ix<Q-1;ix++)for(iy=0;iy<Q-1;iy++)BTh=.1,GTh=.33,GMTh=.5,DSSS=-.1,H[ix][iy]>0*Mxx&&H[ix][iy]<BTh*Mxx&&CLgts[ix][iy]/MxxCities>1.1*CLgts2[ix][iy]/MxxCities2&&(Mcraft.fill(173/255-DSSS,164/255-DSSS,112/255-DSSS),Mcraft.rect(ix,iy,1,1)),H[ix][iy]>BTh*Mxx&&H[ix][iy]<GTh*Mxx&&CLgts[ix][iy]/MxxCities>1*CLgts2[ix][iy]/MxxCities2&&(Mcraft.fill(43/255,74/255,7/255),Mcraft.rect(ix,iy,1,1)),H[ix][iy]>GTh*Mxx&&H[ix][iy]<GMTh*Mxx&&CLgts[ix][iy]/MxxCities>1.3*CLgts2[ix][iy]/MxxCities2&&(Mcraft.fill(75/255,56/255,37/255),Mcraft.rect(ix,iy,1,1)),H[ix][iy]>GMTh*Mxx&&H[ix][iy]<Mxx&&CLgts[ix][iy]/MxxCities>1.2*CLgts2[ix][iy]/MxxCities2&&(Mcraft.fill(70/255,70/255,76/255),Mcraft.rect(ix,iy,1,1));if(1==MCGRID)for(Mcraft.stroke(0),Mcraft.strokeWeight(.1*M),ix=0;ix<Q-dtt;ix+=dtt)for(iy=0;iy<Q-dtt;iy+=dtt)Mcraft.fill(0,0),Mcraft.rect(ix,iy,dtt)}function CreateBorders(){PolMap=createGraphics(width,height),pc=[],nx=[],ny=[],Npop=[],Cll=[],IX=[],nc2=[],IY=[],PolMap.colorMode(HSB,1),placeCities();for(let j=0;j<Q;j++)Cll[j]=[];for(PolMap.noStroke(),ix=0;ix<Q;ix++)for(iy=0;iy<Q;iy++){for(pc[ix*Q+iy]=-1,ci=0,cd=1e4,ld=cd,dx=ix+PoliticalMessiness/xs*(Perlin(ix/35*xs,iy/35*xs)-.5)*45,dy=iy+PoliticalMessiness/xs*(Perlin(ix*xs/35+1,iy/35*xs)-.5)*45,i=0;i<Ncount;i++)nd=sqrt(sq(dx-nx[i])+sq(dy-ny[i])),nd<cd?(ld=cd,cd=nd,ci=i):nd<ld&&(ld=nd);Cll[ix][iy]=ci,1!=MAPTYPE&&2!=MAPTYPE||(H[ix][iy]>0&&(PolMap.fill(nc2[Cll[ix][iy]],.3+0*H[ix][iy],.95+.15*H[ix][iy],.8),PolMap.rect(ix,iy,1,1)),H[ix][iy]<=0&&(PolMap.fill(.52,.2,1+5e-4*H[ix][iy],.85),PolMap.rect(ix,iy,1,1)))}for(ix=0;ix<Q-1;ix++)for(iy=0;iy<Q-1;iy++)(abs(Cll[ix][iy]-Cll[ix+1][iy])>0||abs(Cll[ix][iy]-Cll[ix][iy+1])>0)&&(IX.push(ix),IY.push(iy))}function placeCities(){for(SeachingForCityPosition=1,i=0;i<Ncount;i++)nx[i]=floor((i+.15+RN.RNd(.7))%sqrt(Ncount)/sqrt(Ncount)*Q),ny[i]=floor((floor(i/sqrt(Ncount))+.15+RN.RNd(.7))/sqrt(Ncount)*Q),Ncount<6?(Ncount,nc2[i]=i/Ncount+.16):nc2[i]=i/Ncount,1==Ncount&&(nc2[0]=RN.RNc([RN.RNn(0,.4),RN.RNn(.75,1)]))}function GenShadowMap(){QSS=round(Q/(1*M)),xs=1,SHP=[];for(let j=0;j<QSS;j++)SHP[j]=[];for(Shadow=createGraphics(QSS,QSS),Shadow.colorMode(HSB,1),ix=0;ix<QSS;ix++)for(iy=0;iy<QSS;iy++)st1=8*Perlin((ix+xspeed*Tme)/400*xs*P2,(iy+yspeed*Tme)/400*xs*P2,Tme),dst1=Perlin((ix+xspeed*Tme)/40*xs*P2,(iy+yspeed*Tme)/40*xs*P2,Tme),nss1=Perlin((ix+xspeed*Tme)/100*xs*P2,(iy+yspeed*Tme)/100*xs*P2,st1+dst1,Tme),st2=8*Perlin((ix+xspeed*Tme)/800*xs*P2,(iy+yspeed*Tme)/800*xs*P2,Tme),dst2=Perlin((ix+xspeed*Tme)/80*xs*P2,(iy+yspeed*Tme)/80*xs*P2,Tme),nss2=1.5*Perlin((ix+xspeed*Tme)/200*xs*P2,(iy+yspeed*Tme)/200*xs*P2,st2+dst2,Tme),rgh=Perlin((ix+xspeed*Tme)/600*xs*P2,(iy+yspeed*Tme)/600*xs*P2,Tme)-.3,bpd=Perlin((ix+xspeed*Tme)/20*xs*P2,(iy+yspeed*Tme)/20*xs*P2,Tme),bmp=Perlin((ix+xspeed*Tme)/50*xs*P2,(iy+yspeed*Tme)/50*xs*P2,2*bpd,Tme),SHP[ix][iy]=nss1+sq(sq(nss2))+rgh*bmp-.8,SHP[ix][iy]=SHP[ix][iy]/.5,Shadow.fill(ConCol3[0],ConCol3[1],.9*SHP[ix][iy],.6*SHP[ix][iy]),Shadow.noStroke(),Shadow.rect(ix,iy,1,1)}function LSB(){SBI=createGraphics(Q,Q),SBI.colorMode(HSB,1),SBI2=createGraphics(Q,Q),SBI2.colorMode(HSB,1),SBI3=createGraphics(Q,Q),SBI3.colorMode(HSB,1),SBI4=createGraphics(Q,Q),SBI4.colorMode(HSB,1),SB=[];for(let j=0;j<Q;j++)SB[j]=[];for(ix=0;ix<Q;ix++)for(iy=0;iy<Q;iy++)H[ix][iy]>0?SB[ix][iy]=1:SB[ix][iy]=0;for(SBI.stroke(1,1,0),SBI.strokeWeight(1.75*M),SBX=[],SBY=[],ix=0;ix<Q-1;ix++)for(iy=0;iy<Q;iy++)4==MAPTYPE&&(H[ix][iy]>0?SBI.fill(.3,.3,1):SBI.fill(.6,.3,1),SBI.noStroke(),H[ix][iy]>.33*Mxx&&SBI.stroke(ConCol),SBI.rect(ix,iy,1,1)),(abs(SB[ix][iy]-SB[ix+1][iy])>0||abs(SB[ix][iy]-SB[ix][iy+1])>0)&&(SBX.push(ix),SBY.push(iy));for(i in SBI3.strokeWeight(1*M),SBI4.strokeWeight(1*M),SBI2.strokeWeight(1.75*M),SBI3.stroke(0),SBI4.stroke(0,.5),SBI2.stroke(.6,1,.6),(1==MAPTYPE||2==MAPTYPE||3==MAPTYPE)&&SBI4.stroke(0,1),SBX)SBI3.point(SBX[i],SBY[i]),SBI4.point(SBX[i],SBY[i]),SBI2.point(SBX[i],SBY[i])}function CreateBorder(){if(MapBorder=createGraphics(Qfull,Qfull),MapBorder.colorMode(HSB,1),MapBorder.noFill(),MapBorder.stroke(0),MapBorder.strokeWeight(1*M),dn=-0*M,MapBorder.square(xstart+dn,ystart+dn,Q-2*dn),dn=-2*M,MapBorder.square(xstart+dn,ystart+dn,Q-2*dn),dn=-10*M,MapBorder.square(xstart+dn,ystart+dn,Q-2*dn),OBD=35,dn=-OBD*M,MapBorder.square(xstart+dn,ystart+dn,Q-2*dn),dn=-(OBD+5)*M,MapBorder.strokeWeight(2*M),MapBorder.square(xstart+dn,ystart+dn,Q-2*dn),dn=-(OBD+10)*M,MapBorder.strokeWeight(2*M),MapBorder.square(xstart+dn,ystart+dn,Q-2*dn),MapBorder.textSize(width/30),"Island"==fn&&(DC=RN.RNc([.1,.2])),"MainLandCoast"==fn&&(DC=RN.RNc([.5,1])),"Island Chain"==fn&&(DC=RN.RNc([.25,.5])),"Landlocked"==fn&&(DC=RN.RNc([.5,1])),"SparseIslands"==fn&&(DC=RN.RNc([.1,.2])),4==MAPTYPE&&(DC=RN.RNc([.1])),RC1=RN.RNd(),RC2=RN.RNd(),DIN=RN.RNi(0,70),DIW=RN.RNi(0,70),5!=MAPTYPE&&7!=MAPTYPE&&8!=MAPTYPE&&9!=MAPTYPE)for(i=0;i<11;i++)MapBorder.strokeWeight(1*M),MapBorder.noStroke(),MapBorder.fill(0),MapBorder.textSize(width/80),MapBorder.textAlign(CENTER,CENTER),60==MAPTYPE&&(MapBorder.text(RndN(DIW+i*DC,1),Qfull/12+Qfull*i/12,.93*Qfull),MapBorder.text(RndN(DIW+i*DC,1),Qfull/12+Qfull*i/12,.07*Qfull),MapBorder.text(RndN(DIN+(10-i)*DC,1),.07*Qfull,Qfull/12+Qfull*i/12),MapBorder.text(RndN(DIN+(10-i)*DC,1),.93*Qfull,Qfull/12+Qfull*i/12)),MapBorder.strokeWeight(.5*M),1==MAPTYPE?MapBorder.stroke(0):MapBorder.stroke(.5),MapBorder.line(Qfull/12+Qfull*i/12,.913*Qfull,Qfull/12+Qfull*i/12,.0873*Qfull),MapBorder.line(.0873*Qfull,Qfull/12+Qfull*i/12,.913*Qfull,Qfull/12+Qfull*i/12)}function CreateRegionNames(){lang=makeRandomLanguage(),FNt=RN.RNc(["Serif","Courier New","Segoe script"]),FNt="Serif",MAPTYPE==6?FNt="Serif":0,Regions=createGraphics(Q,Q),Regions.textFont(FNt),FindMinMax(Cll),BR=landBright/landPixel,NAMESPACE=[];for(let j=0;j<Q;j++)NAMESPACE[j]=[];for(iC=0;iC<=MxxC;iC++){for(sx=0,sy=0,sc=0,ix=0;ix<Q;ix++)for(iy=0;iy<Q;iy++)0==iC&&(NAMESPACE[ix][iy]=0),Cll[ix][iy]==iC&&H[ix][iy]>=0&&(sx+=ix,sy+=iy,sc+=1);if(Regions.colorMode(HSB,1),(1==MAPTYPE||5==MAPTYPE)&&(BR<5?(Regions.stroke(0),Regions.strokeWeight(2*M),Regions.fill(1)):(Regions.noStroke(),Regions.strokeWeight(2*M),Regions.fill(0))),1==MAPTYPE&&3==CCol&&(Regions.stroke(1),Regions.strokeWeight(.25*M),Regions.fill(1)),6==MAPTYPE&&(Regions.stroke(ConCol2),Regions.strokeWeight(2*M),Regions.fill(0)),Reg=capitalize(makeName(lang,"Region")),LAN1=lang.structure,Regions.textSize(21*M),"Rockwell"!=FNt?Regions.textStyle(BOLD):Regions.textStyle(NORMAL),Regions.textAlign(CENTER,CENTER),xcn=sx/sc,ycn=sy/sc,!(xcn<.07*Q||xcn>.93*Q||ycn>.95*Q||ycn<.05*Q)){for(ddx=115*M,ddy=20*M,XZZ=0,xst=round(xcn-ddx),xen=round(xcn+ddx),yst=round(ycn-ddy),yen=round(ycn+ddy),xst<0&&(xst=0),xen>Q-1&&(xen=Q-1),yst<0&&(yst=0),yen>Q-1&&(yen=Q-1),nrx=xst;nrx<xen;nrx++){for(nry=yst;nry<yen;nry++)1!=NAMESPACE[nrx][nry]||(XZZ=1);XZZ}if(1!=XZZ){for(nrx=xst;nrx<xen;nrx++)for(nry=yst;nry<yen;nry++)NAMESPACE[nrx][nry]=1;Regions.text(Reg,xcn,ycn)}}}for(i in TH=.5,ddx=85*M,ddy=13*M,"Island"==fn&&(TH=.25),"MainLandCoast"==fn&&(TH=.025),"Island Chain"==fn&&(TH=0),"Landlocked"==fn&&(TH=.5),"SparseIslands"==fn&&(TH=0),PDS(TH,100),PX2=[],PY2=[],PX)PX2[i]=(Q-1)*(PX[i]-min(PX))/(max(PX)-min(PX)),PY2[i]=(Q-1)*(PY[i]-min(PY))/(max(PY)-min(PY));for(k in RNDNUMS(),DC=RN.RNn(1,2),PX2)if(i=ranNums[k],ixr=round(PX2[i]),iyr=round(PY2[i]),City=capitalize(makeName(lang,"city")),LAN2=lang.structure,6!=MAPTYPE?MTHr=.6:MTHr=.34,XZZ=0,xst=round(ixr-ddx),xen=round(ixr+ddx),yst=round(iyr-ddy+6*M*1.5),yen=round(iyr+ddy+6*M*1.5),H[ixr][iyr]>=0.05*Mxx&&H[ixr][iyr]<Mxx*MTHr){if(xst<0||xen>Q-1||yst<0||yen>Q-1)continue;for(nrx=xst;nrx<xen;nrx++){for(nry=yst;nry<yen;nry++)1!=NAMESPACE[nrx][nry]||(XZZ=1);XZZ}if(1==XZZ)continue;if(ixr<.07*Q||ixr>.93*Q||iyr>.95*Q||iyr<.05*Q)continue;for(nrx=xst;nrx<xen;nrx++)for(nry=yst;nry<yen;nry++)NAMESPACE[nrx][nry]=1;Regions.stroke(0),Regions.fill(0),Regions.strokeWeight(1*M),2==MAPTYPE&&(Regions.stroke(0),Regions.fill(1)),4==MAPTYPE&&(Regions.stroke(0),Regions.fill(1)),6!=MAPTYPE?(Regions.fill(ConCol),CTSC=.75):(Regions.fill(0),CTSC=.68),Regions.ellipse(ixr,iyr-4*M,CTSC*M*6),(1==MAPTYPE||5==MAPTYPE)&&(BR<5?(Regions.stroke(0),Regions.strokeWeight(3*M),Regions.fill(ConCol)):(Regions.noStroke(),Regions.strokeWeight(3*M),Regions.fill(0))),6==MAPTYPE&&(Regions.stroke(ConCol2),Regions.strokeWeight(2*M),Regions.fill(0),Regions.textStyle(BOLDITALIC)),Regions.textSize(16*M),Regions.text(City,ixr,iyr+6*M*1.5)}function RNDNUMS(){for(i in nums=[],PX2)nums[i]=i;for(ranNums=[],i=nums.length,j=0;i--;)j=Math.floor(RN.RNd()*(i+1)),ranNums.push(nums[j]),nums.splice(j,1)}}function PDS(TH,Rad){k=30,grid=[],wss=Rad/1.4,active=[],ordered=[],Y=1e3,cols=floor(Y/wss),rows=floor(Y/wss);for(var o=0;o<cols*rows;o++)grid[o]=void 0;var e=Y/2,d=Y/2,t=(o=floor(e/wss),floor(d/wss)),i=createVector(e,d);grid[o+t*cols]=i,active.push(i);for(var a=0;a<1e3;a++)if(active.length>0){for(var s=floor(RN.RNn(0,active.length)),c=(i=active[s],!1),l=0;l<k;l++){var f=createVector(RN.RNn(-500,500),RN.RNn(-500,500)),v=RN.RNn(Rad,2*Rad);f.setMag(v),f.add(i);var g=floor(f.x/wss),h=floor(f.y/wss);if(g>-1&&h>-1&&g<cols&&h<rows&&!grid[g+h*cols]){var n=!0;for(o=-1;o<=1;o++)for(t=-1;t<=1;t++){var p=grid[g+o+(h+t)*cols];p&&p5.Vector.dist(f,p)<Rad&&(n=!1)}if(n){c=!0,grid[g+h*cols]=f,active.push(f),ordered.push(f);break}}}c||active.splice(s,1)}for(PX=[],PY=[],o=0;o<ordered.length;o++)ordered[o]&&RN.RNn(0,1)>TH&&(PX.push(ordered[o].x),PY.push(ordered[o].y));return PX,PY}function plotcoCRpass(dx,dy,CR){for(n=.15,n2=.22,n3=.29,n4=.45,r=1.6,fill(sclcol),stroke(sclcol),strokeWeight(0),push(),translate(dx,dy),textFont("Serif"),textSize(10*M),textStyle(BOLD),textAlign(CENTER,CENTER),text("N",0,-1.26*CR),beginShape(),vertex(-CR,0),vertex(-n*CR,n*CR),vertex(0,CR),vertex(n*CR,n*CR),vertex(CR,0),vertex(n*CR,-n*CR),vertex(0,-CR),vertex(-n*CR,-n*CR),endShape(CLOSE)