0x4e17…8429

All memos sent from and to 0x4e17…8429.

console.log("Esoterra v.12 © Matto 2022"),console.log("Welcome to the Chainlife Esoterra viewer. This renders a heightmap based on the neighbor count of each cell. It uses Esoterra type, but it doesn't yet use any Esoterra entropy. This is a proof of concept."),console.log("Although it's not the seed exactly, the seed is exportable with E, token date download with D, the neighbor map is exportable with N, and the neighbor count changes on transfer (preview like you do on a Chainlife token).");let lastZenMint=500,worldSide=64,gridS,w,hW,p,bkg,pal,vB,input,button,previewBin,previewSeed,canvas,born=0,htmlCol=0,lLim=9999,tLit=Math.floor(lLim/23.8),rec=!1,flipU=!1,inv=!1,pro=!1,matured=!1,joy=!1,shifting=!1,customRulePrev=!1,customRuleOn=!1,expa=!1,OG=!1,showoff=!1,grad=!1,zenMint=!1,lit=!1,mm=!1,inp="",sE=[],htmlCols=[],seedSpaced=[],chars=["∨","∧","⊻","↓","↑","⊙"],attributes=[],palStateStr="Base",joyStrings=["Standard","Joy towards the beginning","Joy towards the end","Joy throughout"],cellStyleStrings=["Shifting","Square","Rounded Square","Circle","Diamond","Horizontal","Vertical","Triangle","X","Ellipses/Arc","Random Quad","Random Lines"],hexPat=/^0[xX]{1}[a-fA-F0-9]{40}$/,tokenEntropyVal=createPairs(scriptInputs.token_entropy),cOwnerBin=createBin(scriptInputs.current_owner),pOwnerBin=createBin(scriptInputs.previous_owner),tCount=parseInt(scriptInputs.transfer_count),lShift=parseInt(scriptInputs.level_shift),level=tCount+lShift;level>lLim&&(level=lLim);let tID=parseInt(scriptInputs.token_id),idB=tID%2,mode=tCount%6,char=chars[mode],seed=setSeed(cOwnerBin,pOwnerBin),seedBin=createBin(seed),bfr=5*getVal(1,3);5==getVal(1,5)&&(expa=!0,bfr=Math.min(25,16+level)),setGS(),seedSpaced=0==idB?[0,0,0,0].concat(seed,[0,0,0,0,0]):[0,0,0,0,0].concat(seed,[0,0,0,0]),sE.push(seedE(seedSpaced));let state=Array(gridS),next=Array(gridS),minD=Math.min(window.innerWidth,window.innerHeight),canD=minD,cDH=canD/2;setW(),tID<=lastZenMint&&(zenMint=!0),(level>=tLit||tID==tLit)&&(lit=!0),(level>=Math.floor(lLim/10)||tID==Math.floor(lLim/10))&&(mm=!0);let esoTdesc=["Meta","Water","Land","Mountain","Sky"],col=[["#111111","#1b1bb3","#dfdff2","Enso",[0]],["#fcd612","#43AA8B","#275bb2","FOCUS",[0]],["#1f1278","#fb6e49","#c2254b","Sunset",[4]],["#4b0082","#ffd700","#ff6347","Sea Anemone",[1]],["#ffd56c","#f1525d","#058990","Spiny Viper",[2]],["#483d8b","#ff1493","#cce7ff","Parrotfish",[1]],["#92fffe","#a51504","#012c74","San Francisco Garter",[1,2]],["#ff0000","#ffdb00","#331c00","Magma",[1,3]],["#f336bf","#54b5f7","#fcd64c","Mandrill",[2]],["#f8910b","#eeeeee","#111111","Tiger",[2]],["#2d1961","#22ff9f","#17c1ad","Aurora Borealis",[4]],["#ffba03","#d50104","#0690ce","Macaw",[2,4]],["#f62e0c","#f0dfe2","#f5b85e","Koi",[1]],["#d7b2de","#3646d8","#4fa5a2","Lilac Breasted Roller",[2,4]],["#0000ff","#0101A0","#010140","Mariana",[1]],["#007f00","#452e15","#fcfcd3","Alpine",[3,4]],["#00bfff","#fff5ac","#f8f8ff","Partly Cloudy",[4]],["#f0a205","#95610f","#4e2d18","Dog's Eyes",[2]],["#2e398c","#d9def3","#4dab27","Blue Marble",[1,2,3,4]],["#111111","#424242","#eeeeee","Mono",[0]]];if((p=getVal(0,19))>12){let e=100-(p-12)*5;getVal(1,100)>e&&(p=(p-13)*2)}10==p&&level%2==0&&(col[p][1]="#d530b7"),12==p&&level%2==0&&(col[p][1]="#363d47"),htmlCols=["white",col[p][0],col[p][1],col[p][2],"black"];let style=getVal(1,11);if(style>=9){let t=100/(style-7);getVal(1,100)>t&&(style-=5)}1==getVal(1,5)&&(showoff=!0),1==getVal(1,20)&&p>1&&(grad=!0),tID%10!=0||grad||showoff||(OG=!0);let live=col[p][0],dying=col[p][1],dead=col[p][2];level>=6&&(flipU=!0,palStateStr="Flipping Unlocked"),(1==getVal(1,50)||level>=10)&&(inv=!0,live=col[p][2],dead=col[p][0],palStateStr="Inverted Palette"),level>=14&&(pro=!0,palStateStr="Rotation Unlocked"),level>=16&&(matured=!0),OG&&(dying=dead),getVal(1,50);let ru=getVal(1,100),joyS=getVal(1,100);joyS<4?joy=!0:joyS=0;let shiftingV=getVal(1,200);shiftingV<2&&(shifting=!0);let wIn=getVal(1,100);wIn=wIn<2?64:wIn<4?32:wIn<7?16:wIn<11?8:wIn<16?4:wIn<22?2:0;let wRe=getVal(1,100);wRe=wRe<2?64:wRe<4?32:wRe<7?16:wRe<11?8:wRe<16?4:wRe<22?2:0;let esoTen=`${getVal(0,99)}${getVal(0,99)}${getVal(0,99)}${getVal(0,99)}${getVal(0,99)}`,wGC=tID%worldSide,wGR=Math.floor(tID/worldSide);if(0==wGC||63==wGC||0==wGR||63==wGR){console.log("BONUS REACH AND INFLUENCE BONUS! ;)");let n=8;(0==tID||63==tID||4032==tID||4095==tID)&&(n=32),wRe<n&&(wRe=n),wIn<n&&(wIn=n)}addAttri("World Position",`(${tID%worldSide}, ${Math.floor(tID/worldSide)})`),addAttri("Community Influence Bonus",wIn),addAttri("Community Reach Bonus",wRe),addAttri("Joy",joyStrings[joyS]),addAttri("Habitat Size",(gridS-2)**2),addAttri("Showoff",showoff),addAttri("Aurora",grad),addAttri("OG",OG),addAttri("Palette",col[p][3]);let esoTlist="";for(let i=0;i<col[p][4].length;i++)esoTlist+=esoTdesc[col[p][4][i]],i<col[p][4].length-1&&(esoTlist+="/");function addAttri(e,t){"boolean"==typeof t&&(t=t.toString()),attributes.push({trait_type:e,value:t})}function createPairs(e){let t=[];for(let n=0;n<(e.length-2)/2;n++)t.push(parseInt(e.slice(2+2*n,4+2*n),16));return t}function createBin(e){let t="";if(Array.isArray(e))for(let n=0;n<e.length;n++)t+=e[n];else for(let r=2;r<e.length;r++)t+=parseInt(e[r],16).toString(2).padStart(4,0);return t}function getVal(e,t){t+=.999;let n=Math.floor(tokenEntropyVal[0]*(t-e)/255+e);return tokenEntropyVal.shift(),n}function setSeed(e,t){let n=[];for(let r=0;r<e.length;r++){let a=parseInt(e[r])+parseInt(t[r]);0===mode&&(a>0?n[r]=1:n[r]=0),1===mode&&(2===a?n[r]=1:n[r]=0),2===mode&&(1===a?n[r]=1:n[r]=0),3===mode&&(a>0?n[r]=0:n[r]=1),4===mode&&(2===a?n[r]=0:n[r]=1),5===mode&&(1===a?n[r]=0:n[r]=1)}return n}function seedE(e){let t="";for(let n=0;n<e.length;n++)n>0&&n%13==0&&(t+="$"),"0"==e[n]?t+="b":t+="o";return t+"!"}function checkInput(){inp=input.value(),input.hide(),button.hide(),inp.match(hexPat)?(console.log(`Player entered: ${inp}`),console.log("Valid hex address has been entered"),mode<5?mode++:mode=0,previewBin=createBin(inp),char=chars[mode],console.log(`Logic gate that will be applied next transfer: ${char}`),previewSeed=setSeed(previewBin,cOwnerBin),createBin(previewSeed),seedSpaced=0==idB?[0,0,0,0].concat(previewSeed,[0,0,0,0,0]):[0,0,0,0,0].concat(previewSeed,[0,0,0,0]),(sE=[]).push(seedE(seedSpaced)),inp="",rec=!1,bfrChange()):(console.log("Input rejected"),alert("Input rejected. Enter an Ethereum public address.")),inp="",rec=!1}function keyTyped(){let e=key.toUpperCase();"\"===e&&(!1===rec?(rec=!0,(input=createInput()).position(window.innerWidth/2-80,window.innerHeight/2),(button=createButton("⯈")).position(input.x+input.width,input.y),button.mousePressed(checkInput)):(rec=!1,input.hide(),button.hide())),!1===rec?"S"===e?saveCanvas(`ChainLife-Esoterra-${tID}_Level-${level}`,"png"):"E"===e?saveStrings([`#C Pattern of Chainlife Esoterra ${tID}`,"x = 13, y = 13, rule = B3/S23",sE],`ChainLife-${tID}_Level-${level}_Pattern`,"rle"):"D"===e?saveStrings([`ChainLife Esoterra Render: ${tID}`,`Level ${level} (transfer count: ${tCount}) + level shift: ${lShift})`,`Random token entropy: ${scriptInputs.token_entropy}`,`Previous owner (hexidecimal): ${scriptInputs.previous_owner}`,`Current owner (hexidecimal): ${scriptInputs.current_owner}`,"","The seed is made by applying a logic gate to the binary representations of the owner addresses...",`Previous owner (binary): ${pOwnerBin}`,`Current owner (binary): ${cOwnerBin}`,`Seed (after ${char} operation): ${seedBin}`,`Seed Pattern (RLE): ${sE}`],`ChainLife-${tID}_Data`):"T"===e&&zenMint?(grad=!1,tID%2==0?(live="#111111",dead="#dfdff2"):(live="#dfdff2",dead="#111111"),dying="#1b1bb3",bkg=dead):"Y"===e&&zenMint?(grad=!1,tID%2==0?(live="#fcd612",dead="#275bb2"):(live="#275bb2",dead="#fcd612"),dying="#43AA8B"):"M"===e&&mm?(grad=!1,live="#00FF41",dying=tID%2==0?"#003B00":"#008F11",dead="#000000",bkg="#000000"):"N"===e&&saveStrings(next,`ChainLife-Esoterra-${tID}_Level-${level}_Neighbor-HeightMap`,"txt"):(keyCode===ENTER||keyCode===RETURN)&&checkInput()}function setup(){randomSeed(level),(canvas=createCanvas(window.innerWidth,window.innerHeight,WEBGL)).parent("canvas-container"),camera(0,-canD,canD/2/tan(PI/6),0,-200,0,0,1,0),colorMode(RGB,255,255,255,1),setGrid(),describeFeatures()}function describeFeatures(){let e=this.canvas.id;this.dummyDOM=document.getElementById(e).parentNode;let t=`<div id="${e}_Description" role="region" aria-label="${altText=`Chainlife is a generative art project that explores two-dimensional cellular automata, and on-chain owner collaboration. It was made by an artist named Matto, and released in 2022. This is an alternative render of the Chainlife token with ID number, ${tID}. It's called an, Ezzo-Terra. It's a 3d projection of on-chain data, where the number of each cell's live neighbors is rendered as a height-map. In this Ezzo-Terra, the palette being used is called, ${col[p][3]}.`}"></div>`;this.dummyDOM.querySelector(`#${e}`).innerHTML=t}function bfrChange(){setGS(),setW(),setGrid()}function setGS(){gridS=13+2*bfr}function setW(){hW=(w=canD/gridS)/2}function setGrid(){for(let e=0;e<gridS;e++)state[e]=Array(gridS),next[e]=Array(gridS);let t=0;for(let n=0;n<gridS;n++)for(let r=0;r<gridS;r++)n<bfr||n+bfr+1>gridS||r<bfr||r+bfr+1>gridS?state[n][r]=0:(state[n][r]=seedSpaced[t],t++),next[n][r]=0}addAttri("Esoterra Type",esoTlist),addAttri("Esoterra Entropy",esoTen),addAttri("Palette State",palStateStr),lit&&addAttri("Lit?","LIT!"),mm&&addAttri("Eventuality","Awakened"),sessionStorage.setItem("attributes",JSON.stringify(attributes));let voxelSize=20,bbTranslation,bbHeight,voxHratio=1,growthFactor=1,translateAdjust=0,noGround=[0,1,2,10,16,19].includes(p),spread=1,direction=1,lerpDiv=7;function draw(){orbitControl(4,4,.1),directionalLight(200,200,200,.5,1,-1),ambientLight(127,127,127),background(240),[2,3,5,6,7,10,11,12,13,14,15,16,18].includes(p)&&(stroke("blue"),[2,10,11,13,15,16].includes(p)&&stroke("azure"),[2,10,16].includes(p)?(bbTranslation=0,bbHeight=18):[3,5,11,12,13].includes(p)?(bbTranslation=6.5,bbHeight=12):14==p?(bbTranslation=6.3,bbHeight=12):6==p?(bbTranslation=.75,bbHeight=1):7==p?(bbTranslation=.7,bbHeight=2):15==p?(bbTranslation=14.7,bbHeight=30):18==p&&(bbTranslation=.75,bbHeight=1),noFill(),push(),translate(0,-(bbTranslation*voxelSize),0),box((gridS-2)*voxelSize,bbHeight*voxelSize,(gridS-2)*voxelSize),pop(),18==p&&(stroke("azure"),push(),translate(0,-(6.3*voxelSize),0),box((gridS-2)*voxelSize,10*voxelSize,(gridS-2)*voxelSize),pop())),noStroke();for(let e=1;e<gridS-1;e++)for(let t=1;t<gridS-1;t++){let n=0;for(let r=-1;r<=1;r++)for(let a=-1;a<=1;a++)(0!=r||0!=a)&&(n+=Math.floor(state[e+r][t+a]));if([3,5,12,4,8,9,17].includes[p]?(voxHratio=2,translateAdjust=0):[0,1,19].includes(p)?(spread=3,lerpDiv=n,voxHratio=1,translateAdjust=-voxelSize):[2,10,16].includes[p]?(voxHratio=.5,translateAdjust=2):[11,13].includes[p]?(voxHratio=2,translateAdjust=0):6==p?(voxHratio=2,translateAdjust=0):7==p?translateAdjust=voxelSize/(2*(voxHratio=1.5)):14==p?(translateAdjust=voxelSize/(2*(voxHratio=1.5)),direction=-1):15==p?translateAdjust=voxelSize/(2*(voxHratio=1.5)):18==p&&(lerpDiv=n,voxHratio=2),push(),translate(spread*voxelSize*(t-(gridS-1)/2),0,spread*voxelSize*(e-(gridS-1)/2)),[2,10,16].includes(p))fill(lerpColor(color(dead),color(live),n/7)),0!=n&&box(voxelSize,n*voxelSize/2,voxelSize);else for(let o=0;o<=n;o++)[0,1,19].includes(p)&&(growthFactor=o/2),[7,14,15].includes(p)&&(growthFactor=o),translate(0,direction*(-(growthFactor*voxelSize)/voxHratio+translateAdjust),0),0==n?fill(dead):fill(lerpColor(color(dying),color(live),(o-1)/lerpDiv)),(noGround&&0!=n||!noGround)&&box(voxelSize,growthFactor*voxelSize/voxHratio,voxelSize);pop(),next[t][e]=n}}
console.log("World v.12 © Matto 2022");const levels=64,levelCap=64,mint=4096,side=Math.sqrt(4096),inputPat=/^[lL]{1}[0-9]+$|[tT]{1}[0-9]+$/,voxelSize=10,mapSize=400,generatorURL="https://api.gengames.io/project/chainlife/generator/",tokenURL="https://chainlife.xyz/token/",esoterraURL="https://api.gengames.io/project/chainlife/esoterra/",levelURL="https://api.gengames.io/project/chainlife/level";let singleLevel=-1,singleToken=-1,canvas,record=!1,LevelData;console.log(`Grid: ${side} x ${side} (collection of 4096).`);let levelOf=Array(levelsArray.length);for(let i=0;i<levelsArray.length;i++)levelOf[i]=[],levelOf[i][0]=levelsArray[i].transfer_count+levelsArray[i].level_shift,levelOf[i][0]<0&&(levelOf[i][0]=0),levelOf[i][0]>64&&(levelOf[i][0]=64);let cube=Array(64);for(let z=0;z<=64;z++){cube[z]=Array(side);for(let e=0;e<=side;e++){cube[z][e]=Array(side);for(let l=0;l<=side;l++){let n=e*side+l;levelsArray.length-1>=n?levelOf[n][0]==z?cube[z][e][l]=1:cube[z][e][l]=0:0==z?cube[z][e][l]=.5:cube[z][e][l]=0}}}function setup(){(canvas=createCanvas(windowWidth,windowHeight,WEBGL)).parent("canvas-container"),camera(0,-800,-22.5),describeFeatures()}function describeFeatures(){let e=this.canvas.id;this.dummyDOM=document.getElementById(e).parentNode;let l=`<div id="${e}_Description" role="region" aria-label="${altText="Chainlife is a generative art project that explores two-dimensional cellular automata, and on-chain owner collaboration. It was made by an artist named Matto, and released in 2022. This is a view of the 3d, Chainlife world, where each token is placed on a world-level corresponding to it's token-level. Owners can collaborate by placing their tokens on specific levels to build unique patterns."}"></div>`;this.dummyDOM.querySelector(`#${e}`).innerHTML=l}function keyTyped(){if("\"===key)record=!0,(input=createInput()).position(window.innerWidth/2-80,window.innerHeight/2),(button=createButton("⯈")).position(input.x+input.width,input.y),button.mousePressed(checkInput);else if(keyCode===ENTER||keyCode===RETURN)checkInput();else if(!1==record){if(key=key.toUpperCase(),-1!=singleLevel&&"E"==key){console.log("Preparing seed pattern...");let e=createExport();console.log(`Seed pattern for level ${singleLevel} is:`),console.log(e),saveStrings([`#C Pattern of Chainlife World Level ${singleLevel}`,"x = 64, y = 64, rule = B3/S23",e],`Chainlife-World_level-${singleLevel}`,"rle"),console.log("")}else if(-1!=singleLevel&&"P"==key){console.log("Preparing data...");let l=createExport();console.log(l),window.levelData={level_id:singleLevel,level_seed:l},console.log(`Seed pattern for level ${levelData.level_id} is:`),console.log(levelData.level_seed),console.log(`Opening level ${levelData.level_id} with that seed in a new tab for play.`),window.open("https://api.gengames.io/project/chainlife/level")}else -1!=singleToken&&"G"==key?(console.log(`Opening Chainlife ${singleToken} fullscreen in a new tab.`),window.open("https://api.gengames.io/project/chainlife/generator/"+singleToken)):-1!=singleToken&&"C"==key?(console.log(`Opening Chainlife ${singleToken} page on chainlife.xyz.`),window.open("https://chainlife.xyz/token/"+singleToken)):-1!=singleToken&&"V"==key?(console.log(`Opening Chainlife Esoterra ${singleToken} in a new tab.`),window.open("https://api.gengames.io/project/chainlife/esoterra/"+singleToken)):(singleLevel=-1,singleToken=-1,console.log("Showing all levels."),console.log(""))}}function checkInput(){let e=input.value();if(e=e.toUpperCase(),input.hide(),button.hide(),e.match(inputPat)){let l=parseInt(e.slice(1));"L"==e.slice(0,1)&&l<=64?(singleToken=-1,singleLevel=parseInt(e.slice(1)),console.log(`Only showing level: ${singleLevel}.`)):"T"==e.slice(0,1)&&l<4096&&(singleLevel=levelOf[singleToken=parseInt(e.slice(1))],console.log(`Highlighting token: ${singleToken}, which is on level ${singleLevel}`),console.log("Press 'C' to open this Chainlife."),console.log("Press 'V' to view this Chainlife's Esoterra.")),console.log("Press 'E' to export the seed pattern of this level."),console.log("Press 'P' to play this level as a cellular automata."),console.log("Press any other key to return to world view."),console.log("")}else console.log("Display level by entering 'L'n (n is an integer between 0 and 63), or tokenID by entering 'T'n (n is an integer between 0 and 4095)."),console.log(""),e="";record=!1}function createExport(){let e="";for(let l=0;l<side;l++){0!=l&&(e+="$");for(let n=0;n<side;n++)1!=cube[singleLevel][l][n]?e+="b":e+="o"}return e+"!"}function draw(){stroke("rgba(0,80,80, 1)"),strokeWeight(.5),orbitControl(4,4,.1),background("rgb(240,240,240)");for(let e=-32;e<=32;e++)for(let l=-side/2;l<side/2;l++)for(let n=-side/2;n<side/2;n++){-1==singleLevel?(fill("rgba(0,128,128, 1)"),t()):(singleLevel==e+32?(stroke("rgba(0,80,80, 1)"),fill("rgba(0,128,128, 1)")):(noStroke(),fill("rgba(0,128,128, 0.1)")),t());function t(){cube[e+32][n+side/2][l+side/2]>0&&(push(),translate(-(10*l),-1.5*e*10,-(10*n)),singleToken==(n+side/2)*side+(l+side/2)?(fill("rgba(0,222,222, 1)"),stroke("white")):.5==cube[e+32][n+side/2][l+side/2]&&(stroke("rgba(0,80,80, 0.1)"),noFill()),box(10,10/6,10),pop())}}}
console.log("########################### WELCOME TO CHAINLIFE! ############################"),console.log(""),console.log("THIS TOKEN'S SCRIPT INPUTS ARE..."),console.log(`TOKEN ID: ${scriptInputs.token_id}`),console.log(`TOKEN ENTROPY: ${scriptInputs.token_entropy}`),console.log(`PREVIOUS OWNER: ${scriptInputs.previous_owner}`),console.log(`CURRENT OWNER: ${scriptInputs.current_owner}`),console.log(`TRANSFER COUNT: ${scriptInputs.transfer_count}`),console.log(`LEVEL SHIFT: ${scriptInputs.level_shift}`),console.log(`CUSTOM RULE: ${scriptInputs.custom_rule}`),console.log(""),console.log("##################################################################################"),console.log("");let gridS,w,hW,p,bkg,pal,jLineCol,rset,alive,died,ruMem,vB,input,button,previewBin,previewSeed,canvas,count=0,rad=0,repopC=0,score=0,born=0,htmlCol=0,lLim=9999,tLit=Math.floor(lLim/23.8),rec=!1,clicked=!1,showCyc=!1,logged=!1,zoom=!1,bil=!1,step=!1,flipU=!1,inv=!1,pro=!1,repopU=!1,repop=!1,matured=!1,joy=!1,ghost=!1,shifting=!1,game=!0,endLog=!1,showHelp=!1,showNcount=!1,preview=!1,customRulePrev=!1,customRuleOn=!1,expa=!1,OG=!1,showoff=!1,grad=!1,zenMint=!1,conway=!1,lit=!1,mm=!1,inp="",cyc="",ruLog="",liveMem="",sE=[],log=[],rule=[],rO=[],htmlCols=[],seedSpaced=[],chars=["∨","∧","⊻","↓","↑","⊙"],attributes=[],palStateStr="Base",joyStrings=["Standard","Sparkling","Sphere"],maturityValueStrings=["Not Yet Matured","Unlocked"],maturitySpeedStrings=["Slightly Faster","Normal","Slightly Slower"],cellStyleStrings=["Shifting","Square","Rounded Square","Circle","Diamond","Horizontal","Vertical","Triangle","X","Ellipses/Arc","Random Quad","Random Lines"],hexPat=/^0[xX]{1}[a-fA-F0-9]{40}$/,rulPat=/^[bB]([0-9]+)?/[sS]([0-9]+)?$/,conPat=/^[Cc](onway|ONWAY)/,tokenEntropyVal=createPairs(scriptInputs.token_entropy),cOwnerBin=createBin(scriptInputs.current_owner),pOwnerBin=createBin(scriptInputs.previous_owner),tCount=parseInt(scriptInputs.transfer_count),lShift=parseInt(scriptInputs.level_shift),level=tCount+lShift,lTri=level%3;level>lLim?level=lLim:level<0&&(level=0);let tID=parseInt(scriptInputs.token_id),idB=tID%2,mode=tCount%6,char=chars[mode];console.log(`Logic gate applied to binaries: ${char}`);let seed=setSeed(cOwnerBin,pOwnerBin),seedBin=createBin(seed),bfr=5*getVal(1,3);5==getVal(1,5)&&(expa=!0,bfr=Math.min(25,16+level)),setGS(),seedSpaced=0==idB?[0,0,0,0].concat(seed,[0,0,0,0,0]):[0,0,0,0,0].concat(seed,[0,0,0,0]),sE.push(seedE(seedSpaced));let state=Array(gridS),next=Array(gridS),minD=Math.min(window.innerWidth,window.innerHeight),canD=minD,cDH=canD/2;setW();let idDelay=tID%3-1;tID<=lastZenMint&&(zenMint=!0),(level>=tLit||tID==tLit)&&(lit=!0),(level>=Math.floor(lLim/10)||tID==Math.floor(lLim/10))&&(mm=!0);let esoTdesc=["Meta","Water","Land","Mountain","Sky"],col=[["#111111","#1b1bb3","#dfdff2","Enso",[0]],["#fcd612","#43AA8B","#275bb2","FOCUS",[0]],["#1f1278","#fb6e49","#c2254b","Sunset",[4]],["#4b0082","#ffd700","#ff6347","Sea Anemone",[1]],["#ffd56c","#f1525d","#058990","Spiny Viper",[2]],["#483d8b","#ff1493","#cce7ff","Parrotfish",[1]],["#92fffe","#a51504","#012c74","San Francisco Garter",[1,2]],["#ff0000","#ffdb00","#331c00","Magma",[1,3]],["#f336bf","#54b5f7","#fcd64c","Mandrill",[2]],["#f8910b","#eeeeee","#111111","Tiger",[2]],["#2d1961","#22ff9f","#17c1ad","Aurora Borealis",[4]],["#ffba03","#d50104","#0690ce","Macaw",[2,4]],["#f62e0c","#f0dfe2","#f5b85e","Koi",[1]],["#d7b2de","#3646d8","#4fa5a2","Lilac Breasted Roller",[2,4]],["#0000ff","#0101A0","#010140","Mariana",[1]],["#007f00","#452e15","#fcfcd3","Alpine",[3,4]],["#00bfff","#fff5ac","#f8f8ff","Partly Cloudy",[4]],["#f0a205","#95610f","#4e2d18","Dog's Eyes",[2]],["#2e398c","#d9def3","#4dab27","Blue Marble",[1,2,3,4]],["#111111","#424242","#eeeeee","Mono",[0]]];if((p=getVal(0,19))>12){let e=100-(p-12)*5;getVal(1,100)>e&&(p=(p-13)*2)}10==p&&level%2==0&&(col[p][1]="#d530b7"),12==p&&level%2==0&&(col[p][1]="#363d47"),htmlCols=["white",col[p][0],col[p][1],col[p][2],"black"];let style=getVal(1,11);if(style>=9){let t=100/(style-7);getVal(1,100)>t&&(style-=5)}let lineCount=1+Math.abs((tCount+8)%16-8);1==getVal(1,5)&&(showoff=!0),1==getVal(1,20)&&p>1&&(grad=!0),tID%10!=0||grad||showoff||(OG=!0);let live=col[p][0],dying=col[p][1],dead=col[p][2];level>=6&&(flipU=!0,palStateStr="Flipping Unlocked"),(1==getVal(1,50)||level>=10)&&(inv=!0,live=col[p][2],dead=col[p][0],palStateStr="Inverted Palette"),level>=14&&(pro=!0,palStateStr="Rotation Unlocked"),level>=16&&(matured=!0),OG&&(dying=dead),1==p?fBKG():bkg=dead,1==style&&(rad=0),2==style&&(rad=.25*w),3==style&&(rad=.5*w),(1==getVal(1,50)||level>2)&&(zoom=!0);let ruLoc=[[.75,.75,0],[.75,1.25,0],[1.25,1.25,0],[1.25,.75,0],[1,1,0]],ru=getVal(1,100);rset=ru>60?0:ru>30?1:ru>10?2:3,rule[0]=["LIFE (B3/S23)",[3],[2,3]],rule[1]=["Day & Night (B3678/S34678)",[3,6,7,8],[3,4,6,7,8]],rule[2]=["Long Life (B345/S5)",[3,4,5],[5]],rule[3]=["Seeds (B2/S)",[2],[]],scriptInputs.custom_rule.match(rulPat)?(formRule(scriptInputs.custom_rule,"Custom Ruleset"),matured&&(rset=4)):scriptInputs.custom_rule="",ruMem=rset,rO.push(0,rset),ruLoc[rset][2]=1;let u1=getVal(1,3)+idDelay,u2=getVal(4,7)+idDelay,u3=getVal(8,10)+idDelay,u4=getVal(11,13)+idDelay;level>u1&&rO.push(1),level>u2&&rO.push(2),level>u3&&(rO.push(3),repopU=!0),level>u4&&(customRulePrev=!0);let joyS=getVal(1,100);joyS<3?(joy=!0,grad=!1):joyS=0;let shiftingV=getVal(1,200);shiftingV<2&&(shifting=!0);let wIn=getVal(1,100);wIn=wIn<2?64:wIn<4?32:wIn<7?16:wIn<11?8:wIn<16?4:wIn<22?2:0;let wRe=getVal(1,100);wRe=wRe<2?64:wRe<4?32:wRe<7?16:wRe<11?8:wRe<16?4:wRe<22?2:0;let esoTen=`${getVal(0,99)}${getVal(0,99)}${getVal(0,99)}${getVal(0,99)}${getVal(0,99)}`,wGC=tID%worldSide,wGR=Math.floor(tID/worldSide);if(0==wGC||63==wGC||0==wGR||63==wGR){console.log("BONUS REACH AND INFLUENCE BONUS! ;)");let l=8;(0==tID||63==tID||4032==tID||4095==tID)&&(l=32),wRe<l&&(wRe=l),wIn<l&&(wIn=l)}addAttri("World Grid Coordinates (→,↓)",`(${wGC},${wGR})`),addAttri("World Grid Column",wGC),addAttri("World Grid Row",wGR),addAttri("World Level",level),addAttri("Community Influence Bonus",`${wIn}`),addAttri("Community Reach Bonus",`${wRe}`),addAttri("Transfer Count",tCount),addAttri("Level Shift",lShift),addAttri("Starting Ruleset",rule[rset][0]),addAttri("Joy",joyStrings[joyS]),addAttri("Logic Gate",char),addAttri("Expanding Habitat",expa),addAttri("Habitat Size",(gridS-2)**2),addAttri("Showoff",showoff),addAttri("Aurora",grad),addAttri("OG",OG),addAttri("Organism Style",shifting?cellStyleStrings[0]:cellStyleStrings[style]),addAttri("Palette",col[p][3]);let esoTlist="";for(let i=0;i<col[p][4].length;i++)esoTlist+=esoTdesc[col[p][4][i]],i<col[p][4].length-1&&(esoTlist+="/");function addAttri(e,t){"boolean"==typeof t&&(t=t.toString()),attributes.push({trait_type:e,value:t})}function evolStrVal(e){return e?maturityValueStrings[1]:maturityValueStrings[0]}function createPairs(e){let t=[];for(let l=0;l<(e.length-2)/2;l++)t.push(parseInt(e.slice(2+2*l,4+2*l),16));return t}function createBin(e){let t="";if(Array.isArray(e))for(let l=0;l<e.length;l++)t+=e[l];else{console.log(`Creating binary from ${e}...`);for(let o=2;o<e.length;o++)t+=parseInt(e[o],16).toString(2).padStart(4,0)}return console.log(`Result: ${t}`),console.log(""),t}function getVal(e,t){t+=.999;let l=Math.floor(tokenEntropyVal[0]*(t-e)/255+e);return tokenEntropyVal.shift(),l}function setSeed(e,t){let l=[];for(let o=0;o<e.length;o++){let r=parseInt(e[o])+parseInt(t[o]);0===mode&&(r>0?l[o]=1:l[o]=0),1===mode&&(2===r?l[o]=1:l[o]=0),2===mode&&(1===r?l[o]=1:l[o]=0),3===mode&&(r>0?l[o]=0:l[o]=1),4===mode&&(2===r?l[o]=0:l[o]=1),5===mode&&(1===r?l[o]=0:l[o]=1)}return l}function seedE(e){let t="";for(let l=0;l<e.length;l++)l>0&&l%13==0&&(t+="$"),"0"==e[l]?t+="b":t+="o";return t+"!"}function upR(e){ruLoc[rset][2]=0,ruLoc[rset=e][2]=1,3!=e&&(ruMem=e),game&&!endLog&&(log.push(""),log.push(`New Rule Set: ${rule[rset][0]}`))}function fBKG(){bkg=tID%2==0?"white":"black"}function formRule(e,t){e=e.toUpperCase();let l,o,r=[],n=[],a="B",d="S";if(l=e.substring(0,e.indexOf("/")),o=e.slice(e.indexOf("/")+1),"B"===l.substring(0,1))for(let s=1;s<l.length;s++){let c=parseInt(l.substring(s,s+1));!1===r.includes(c)&&(r.push(c),a+=c.toString())}if("S"===o.substring(0,1))for(let $=1;$<o.length;$++){let _=parseInt(o.substring($,$+1));!1===n.includes(_)&&(n.push(_),d+=_.toString())}rule[4]=[`${t} (${a}/${d})`,r,n],customRuleOn=!0}function checkInput(){inp=input.value(),input.hide(),button.hide(),inp.match(hexPat)||inp.match(rulPat)||inp.match(conPat)?(console.log(`Player entered: ${inp}`),inp.match(hexPat)?preview?alert("To preview another address, you must first refresh the token."):(console.log("Valid hex address has been entered"),preview=!0,game=!1,repopU=!1,mode<5?mode++:mode=0,previewBin=createBin(inp),char=chars[mode],console.log(`Logic gate that will be applied next transfer: ${char}`),previewSeed=setSeed(previewBin,cOwnerBin),createBin(previewSeed),seedSpaced=0==idB?[0,0,0,0].concat(previewSeed,[0,0,0,0,0]):[0,0,0,0,0].concat(previewSeed,[0,0,0,0]),(sE=[]).push(seedE(seedSpaced)),inp="",rec=!1,frameRate(1),bfrChange()):inp.match(conPat)&&!0===matured?(console.log("Conway mode engaged!"),console.log("John Horton Conway FRS (26 December 1937 - 11 April 2020) devised the 'Game of Life' cellular automaton in 1970."),bfr=45,live="black",dying="white",dead="white",bkg="white",showoff=!1,joy=!1,grad=!1,pro=!1,zoom=!1,conway=!0,style=1,rad=0,upR(0),frameRate(1),bfrChange()):inp.match(rulPat)&&customRulePrev?(console.log("Valid ruleset pattern has been entered"),formRule(inp,"Temporary Custom Ruleset"),frameRate(1),upR(4)):(console.log("Input valid but rejected"),alert("That feature hasn't been unlocked...yet."))):(console.log("Input rejected"),!0===matured?alert("Input rejected. Enter an Ethereum public address or a ruleset in the form Bn/Sn (Conway's Game of Life ruleset is B3/S23 which means that cells are born in the next cycle if they have 3 neighbors, and cells survive to the next cycle if they have 2 or 3 neighbors)."):alert("Input rejected. Enter an Ethereum public address.")),inp="",rec=!1}function keyTyped(){let e=key.toUpperCase();if("\"===e&&(!1===rec?(rec=!0,(input=createInput()).position(window.innerWidth/2-80,window.innerHeight/2),(button=createButton("⏵")).position(input.x+input.width,input.y),button.mousePressed(checkInput)):(rec=!1,input.hide(),button.hide())),!1===rec){if(" "===e)mousePressed();else if("S"===e)saveCanvas(`ChainLife-${tID}_Level-${level}_Cycles-${count}`,"png");else if("E"===e)saveStrings([`#C Pattern of Chainlife Token ${tID}`,`x = 13, y = 13, rule = B${list(rule[rset][1])}/S${list(rule[rset][2])}`,sE],`ChainLife-${tID}_Level-${level}_Pattern`,"rle");else if("D"===e)saveStrings([`ChainLife token: ${tID}`,`Level ${level} (transfer count: ${tCount}) + level shift: ${lShift})`,`Random token entropy: ${scriptInputs.token_entropy}`,`Previous owner (hexidecimal): ${scriptInputs.previous_owner}`,`Current owner (hexidecimal): ${scriptInputs.current_owner}`,"","The seed is made by applying a logic gate to the binary representations of the owner addresses...",`Previous owner (binary): ${pOwnerBin}`,`Current owner (binary): ${cOwnerBin}`,`Seed (after ${char} operation): ${seedBin}`,`Seed Pattern (RLE): ${sE}`],`ChainLife-${tID}_Data`);else if("L"===e&&game)saveStrings(log,`ChainLife-${tID}_Level-${level}_GameLog`,"txt");else if("F"===e&&flipU&&!grad){let t=live;live=dead,dead=t}else if("O"===e&&zoom&&bfr<40&&!endLog)bfr++,bfrChange();else if("I"===e&&zoom&&bfr>5&&!endLog)bfr--,bfrChange();else if("A"===e&&repopU)repop=!repop,game=!1,repopC=0,console.log(`Repopulation: ${repop}. Game log is disabled until reload.`);else if("R"===e&&pro&&!grad){let l=live;live=dying,dying=dead,dead=l}else"T"===e&&zenMint?(grad=!1,count%2==0?(live="#111111",dead="#dfdff2"):(live="#dfdff2",dead="#111111"),dying="#1b1bb3",bkg=dead):"Y"===e&&zenMint?(grad=!1,count%2==0?(live="#fcd612",dead="#275bb2"):(live="#275bb2",dead="#fcd612"),dying="#43AA8B",bkg=count%2==0?"white":"black"):"M"===e&&mm?(grad=!1,live="#00FF41",dying=count%2==0?"#003B00":"#008F11",dead="#000000",bkg="#000000"):"B"===e?(grad=!1,live=col[p][0],dying=col[p][1],dead=col[p][2],1==p?fBKG():bkg=dead):"J"===e?joy=!1:"G"===e&&joy?(ghost=!0,liveMem=live,live=dead,dying=dead):"X"===e&&lit?style=Math.floor(random(3,11)):"C"===e?showCyc=!showCyc:"1"===e?frameRate(1):"2"===e?frameRate(2):"3"===e?frameRate(5):"4"===e?frameRate(10):"5"===e?frameRate(20):"6"===e?rO.includes(0)&&upR(0):"7"===e?rO.includes(1)&&upR(1):"8"===e?rO.includes(2)&&upR(2):"9"===e?rO.includes(3)&&upR(3):"0"===e&&matured&&customRuleOn?upR(4):"Q"===e?(clicked=!1,showNcount=!showNcount):"Z"!==e||endLog?"H"===e?(clicked=!1,showHelp=!showHelp):"N"===e?step=!0:"<"===e?(0!=htmlCol?htmlCol--:htmlCol=4,document.body.style.backgroundColor=htmlCols[htmlCol]):">"===e&&(4!=htmlCol?htmlCol++:htmlCol=0,document.body.style.backgroundColor=htmlCols[htmlCol]):bfrChange()}else(keyCode===ENTER||keyCode===RETURN)&&checkInput()}function list(e){let t="";for(let l=0;l<e.length;l++)t+=e[l].toString();return t}function mousePressed(){!1===rec&&(clicked=!clicked,showHelp=!1)}function setup(){randomSeed(level),(canvas=createCanvas(canD,canD)).parent("canvas-container"),textAlign(CENTER,CENTER),rectMode(CENTER),noFill(),frameRate(5),colorMode(RGB,255,255,255,1),setGrid(),describeFeatures()}function describeFeatures(){let e=this.canvas.id;this.dummyDOM=document.getElementById(e).parentNode;let t=`<div id="${e}_Description" role="region" aria-label="${altText=`Chainlife is a generative art project that explores two-dimensional cellular automata, and on-chain owner collaboration. It was made by an artist named Matto, and released in 2022. This is a Chainlife token, with ID number, ${tID}. It's World-View location is column, ${wGC}, row, ${wGR}. In this token, the palette being used is called, ${col[p][3]}. By default, this token uses the cellular automata ruleset, ${rule[rset][0]}, which can be switched during play or changed by the token's level. This token's level is, ${level}, which is calculated by adding the number of times the token has been transferred, ${tCount}, and it's on-chain level-shift value, ${lShift}. Any token at level 16 or above is considered matured...`}"></div>`;this.dummyDOM.querySelector(`#${e}`).innerHTML=t}function bfrChange(){clicked=!1,count=0,setGS(),setW(),log=[],setGrid()}function setGS(){gridS=13+2*bfr}function setW(){hW=(w=canD/gridS)/2}function setGrid(){for(let e=0;e<gridS;e++)state[e]=Array(gridS),next[e]=Array(gridS);let t=0;for(let l=0;l<gridS;l++)for(let o=0;o<gridS;o++)l<bfr||l+bfr+1>gridS||o<bfr||o+bfr+1>gridS?state[l][o]=0:(state[l][o]=seedSpaced[t],t++),next[l][o]=0;log=[`Game log of token ${tID} at level ${level}`,`Seed pattern: ${sE}`,`Rule Set: ${rule[rset][0]}`,`Grid size: ${(gridS-2)**2}`,""]}function draw(){shifting&&clicked&&(style=Math.floor(random(3,11))),textSize(w),alive=0,died=0,noStroke(),background(bkg);for(let e=0;e<gridS;e++)for(let t=0;t<gridS;t++)grad&&(live=lerpColor(lerpColor(color(255,0,0,1),color(255,255,0,1),t/gridS),lerpColor(color(0,0,255,1),color(0,255,255,1),t/gridS),e/gridS),dying=color(red(live),green(live),blue(live),.5)),1==state[e][t]?(fill(live),alive++):.5==state[e][t]?(fill(dying),died++):0==e||e==gridS-1||0==t||t==gridS-1?fill(bkg):fill(dead),rW=e*w,cW=t*w,rWw=rW+w,cWw=cW+w,rC=rW+hW,cC=cW+hW,style<4&&(rect(cC,rC,w,w,rad),showoff&&1==state[e][t]&&(R(255,.3),L(255,.4))),4==style&&(showoff&&1==state[e][t]&&rect(cC,rC,2*w/3,2*w/3),quad(cC,rW,cWw,rC,cC,rWw,cW,rC)),5==style&&(showoff&&1==state[e][t]?(rect(cC,rW+w/6,w,w/3),rect(cC,rW+5*w/6,w,w/3)):rect(cC,rC,w,w/3)),6==style&&(showoff&&1==state[e][t]?(rect(cW+w/6,rC,w/3,w),rect(cW+5*w/6,rC,w/3,w)):rect(cC,rC,w/3,w)),7==style&&(showoff&&count%2==1?triangle(cW,rW,cWw,rWw,cW,rWw):triangle(cW,rW,cWw,rWw,cWw,rW)),8==style&&(showoff&&1==state[e][t]&&(rect(cC,rC,w,w/5),rect(cC,rC,w/5,w)),quad(cW+w/7,rW,cWw,rWw-w/7,cWw-w/7,rWw,cW,rW+w/7),quad(cWw-w/7,rW,cWw,rW+w/7,cW+w/7,rWw,cW,rWw-w/7)),9==style&&(showoff?arc(cC,rC,w,w,mouseX/canD*PI*2,mouseY/canD*PI*2,PIE):count%2==0?arc(cC,rC,w/2,w,2*PI,2*PI,PIE):arc(cC,rC,w,w/2,2*PI,2*PI,PIE)),10==style&&(vB=1==state[e][t]?1:.25,showoff&&1==vB&&H(vB),H(vB)),11==style&&(1===state[e][t]?(stroke(live),vB=1):.5===state[e][t]?(stroke(dying),vB=.5):(stroke(dead),vB=0),strokeWeight(w/12),showoff&&(k(vB),idB=0===idB?1:0),k(vB),noStroke());if(showHelp&&!clicked){showNcount=!1,showCyc=!1,fill("#eeeeee"),rect(cDH,cDH,canD,canD),fill("#111111");let l=canD/25;textSize(canD/35),textStyle(BOLD),text("Chainlife Help",cDH,1.5*l),textSize(canD/40),textStyle(NORMAL),text('Tap/click on the image or press "SPACE" to pause/play the Chainlife.',cDH,3*l),text('Press "1"/"2"/"3"/"4"/"5" to set the speed.',cDH,4*l),text('Press "N" to run one cycle and show the next generation.',cDH,5*l),text('Press "Z" to return the Chainlife to the starting seed.',cDH,6*l),text('Press "Q" to show each cell\u0027s quantity of neighbors.',cDH,7*l),text('Press "C" to show the cycle/generation count.',cDH,8*l),text('Press "6"/"7"/"8"/"9"/"0" to set the ruleset.*',cDH,9*l),text('Press "A" to enable auto-repopulation (disables game-log).*',cDH,10*l),text('Press "I" or "O" to zoom in or out.*',cDH,11*l),text('Press "B" to return the palette to the base/starting state.',cDH,12*l),text('Press "F" to flip the live/dead cell colors.*',cDH,13*l),text('Press "R" to rotate through all palette colors.*',cDH,14*l),text('Press "S" to download a frame (png). Try it now to save this info.',cDH,15*l),text('Press "E" to download the starting seed (uncompressed rle).',cDH,16*l),text('Press "D" to download the token\u0027s current data (txt).',cDH,17*l),text('Press "L" to download the game log (txt).',cDH,18*l),text('Press "<"/">" to cycle through palette colors for the color-matte.',cDH,19*l),text('Press "\" to open the text-input field for previewing changes...',cDH,20*l),text("-Enter an Ethereum address to preview the starting seed if transferred there.",cDH,21*l),text("-Enter a ruleset (Bn/Sn) to preview how an on-chain custom rule will play.*",cDH,22*l),textSize(canD/50),text("More detail can be found on the project's websites (chainlife.xyz / chainlife.nft / matto.xyz).",cDH,23*l),text("*Some functions are unlocked after reaching a certain level.",cDH,24*l)}if(logged||(game&&!endLog&&(0==count?log.push(`At cycle ${count}, the population is ${alive}`):log.push(`At cycle ${count}, the population is ${alive} (${alive-born} survived, ${born} born, ${died} died).`)),logged=!0),joy&&clicked){if(1==joyS){let o="#111111"==live&!ghost||"#111111"==liveMem?"black":"white";(jLineCol=lerpColor(color(live),color(o),.8)).setAlpha(.15),stroke(jLineCol),strokeWeight(1)}for(let r=0;r<gridS;r++)for(let n=0;n<gridS;n++){if(rC=r*w+hW,cC=n*w+hW,1==joyS&&1==state[r][n])for(let a=0;a<random(100,200)-gridS;a++){let d=random(3*w,15*w);line(cC,rC,random(-d,d)+cC,random(-d,d)+rC)}function s(e,t,l,o){let r=o;for(let n=0;n<l;n++)fill(255,255,255,r),circle(e,t,n),r-=r/l}2==joyS&&(1==state[r][n]&&(0==lTri||2==lTri)&&s(cC,rC,randomGaussian(.5,4)*w,random(0,.03)),.5==state[r][n]&&(1==lTri||2==lTri)&&s(cC,rC,randomGaussian(.5,3)*w,random(0,.02)))}noStroke()}fill(live),stroke(dead),strokeWeight(w/8),textSize(.75*w),born=0;for(let c=1;c<gridS-1;c++)for(let $=1;$<gridS-1;$++){let _=0;for(let u=-1;u<=1;u++)for(let f=-1;f<=1;f++)(0!=u||0!=f)&&(_+=Math.floor(state[c+u][$+f]));!0!==showNcount||!1!==clicked||ghost||text(_,$*w+w/2,c*w+w/2);let h=state[c][$],g;1!=h&&rule[rset][1].includes(_)?(g=1,born++):g=1==h&&rule[rset][2].includes(_)?1:1==h?.5:0,next[c][$]=g}if(noStroke(),textSize(w),repop&&clicked){repopC>0&&repopC++;let m=alive/(gridS*gridS)*100;(alive<15||m<1)&&(repopC=1,upR(3)),50==repopC&&(repopC=0,upR(ruMem))}if(0==alive&&0==died&&count>0&&game&&!showHelp){textSize(canD/30),""==cyc&&(score=Math.max(count-2,0)),fill(dead),rect(cDH,cDH,canD,cDH/2),fill(live),bil?(textSize(canD/30*.75),cyc="> 1,000,000,000"):cyc=score.toString();let v=`This Chainlife survived ${cyc} cycles.`,y=`这个 生命线 存活了 ${cyc} 个周期.`,S=`Esta 'Cadena de vida' sobrevivió ${cyc} ciclos.`;text(v,cDH,cDH-cDH/6),text(y,cDH,cDH),text(S,cDH,cDH+cDH/6),endLog||log.push(v),endLog=!0,textSize(w)}if(clicked||step)logged=!1,count>999999999&&(bil=!0,count=0),count++,createNext(),step=!1;else if(!ghost){fill(live),rect(w,w,2*w,2*w),rect(canD-w,w,2*w,2*w),rect(w,canD-w,2*w,2*w),rect(canD-w,canD-w,2*w,2*w),matured?(rect(cDH,0,canD,w),rect(canD,cDH,w,canD),rect(cDH,canD,canD,w),rect(0,cDH,w,canD)):customRulePrev&&(rect(cDH,0,canD/2,w),rect(canD,cDH,w,canD/2),rect(cDH,canD,canD/2,w),rect(0,cDH,w,canD/2)),fill(dead);for(let b=0;b<4;b++)rO.includes(b)&&(C(ruLoc[b][0],ruLoc[b][1],hW),1===ruLoc[b][2]&&(fill(live),C(ruLoc[b][0],ruLoc[b][1],hW/2),fill(dead)));function D(e,t){arc(canD-w,w,w,w,e,t,PIE)}function C(e,t,l){rect(e*w,t*w,l,l)}1===ruLoc[4][2]&&(fill(live),C(ruLoc[4][0],ruLoc[4][1],.75*w),fill(dead),C(ruLoc[4][0],ruLoc[4][1],hW/2)),D(0-HALF_PI,0),flipU&&D(0,HALF_PI),inv&&D(HALF_PI,PI),(pro||conway)&&D(PI,PI+HALF_PI),lit&&(fill(live),circle(canD-w,w,.6*w),fill(dead)),mm&&rect(canD-w,w,.25*w,.25*w),expa&&rect(w,canD-w,.25*w,.25*w),noFill(),stroke(dead),strokeWeight(w/12),expa||rect(w,canD-w,.66*w,.66*w),(zoom||conway)&&circle(w,canD-w,w),noStroke(),strokeWeight(1),fill(dead),textStyle(BOLD),text(char,canD-w,canD-w)}function R(e,t){fill(color(e,e,e,t)),rect(cC,rC,2*w/3,2*w/3,rad)}function L(e,t){fill(color(e,e,e,t)),rect(cC,rC,w/3,w/3,rad)}function H(e){quad(cC+random(-e,e)*hW,rW,cWw,rC+random(-e,e)*hW,cC+random(-e,e)*hW,rWw,cW,rC+random(-e,e)*hW)}function k(e){e+=Math.min(level,18)/6;for(let t=0;t<lineCount;t++)0==idB?line(cC+random(-e,e)*hW,rW+random(-w/6,w/6),cC+random(-e,e)*hW,rWw+random(-w/6,w/6)):line(cWw+random(-w/6,w/6),rC+random(-e,e)*hW,cW+random(-w/6,w/6),rC+random(-e,e)*hW)}showCyc&&!ghost&&0==score&&(matured&&(fill(dead),rect(cDH,hW,7*w,w)),fill(live),textStyle(BOLD),text(count,cDH,hW+w/10))}function createNext(){let e=state;state=next,next=e}addAttri("Esoterra Type",esoTlist),addAttri("Esoterra Entropy",esoTen),addAttri("Palette State",palStateStr),addAttri("Custom Rule Previews",evolStrVal(customRulePrev)),addAttri("Zoom",evolStrVal(zoom)),addAttri("Repopulation",evolStrVal(repopU)),addAttri("Maturation Speed",maturitySpeedStrings[idDelay+1]),addAttri("Maturity Reached",matured),addAttri("Zen. Mint",zenMint),lit&&addAttri("Lit?","LIT!"),mm&&addAttri("Eventuality","Awakened"),sessionStorage.setItem("attributes",JSON.stringify(attributes));
**Chainlife tokens:** microcosms of digital life that are interactive, evolving, and aware.\n\n**Chainlife world:** ever-changing macrocosm that is controlled by you, collaborative, (also) on-chain, and extendible.\n\n**Chainlife forest:** growing a healthy forest ecosystem (not on-chain) to fight climate change and keep Chainlife carbon negative.\n\n**Chainlife project:** genesis project of Matto's Blockchain-interactive NFT platform, GenGames.\n\nLearn more at [chainlife.xyz](https://chainlife.xyz/).