0x865e0647…43a7sent to0x1353fd9d…e4e8·#17,119,473·view on Etherscan
I}),o=e.max(o,i),n+=e.min(1e3*R.rmM(dP.hmM),1e3-n);let a=o*dP.tLR.length;dP.dLN=a>5e4?1:a>1e4?3:a>5e3?10:20,dP.lR=a>5e4?1:a>1e4?2:a>5e3?3:4,dP.tLR.push({thePosH:dP.sH,sW:void 0,dd:1,d1:2e3*dP.gAR/void 0}),dP.lp=!0,dP.totFrames=100,dP.rndArr=[];for(let e=0;e<50;e++)dP.rndArr.push(R.d());dP.shAB=!0,dP.shBx=(-1)**R.c([0,1])*1.25,dP.shBy=(-1)**R.c([0,1])*1.25,dP.shK=2.05,dP.shT=.4*R.d()*2,dP.shBlEqA=.4954,dP.shBlEqB=.648,dP.shBlEqC=1*(dP.shBW?.18:.25),dP.shG=2.5116*(dP.shBW?1.65:1.05),dP.shBr=.01515*(1+Math.log(dP.cK)),dP.shCon=.52*(1+Math.log(dP.cK)),dP.shBr=.15515*dP.cK,dP.shCon=.6,dP.shInv=R.b(.15),dP.shBW=R.b(.15),dP.shTime=1e3*R.d(),readURLParams(dP),(dP.oT>3||dP.oT<0)&&(dP.oT=0)},e.setupObjects=function(){let t,s,d,r,n,o,i,a;o=R.n(1,255);let c,u,h,l,P=R.dd()*e.PI;for(let o=0;o<dP.grid.length;o++)r=R.c(dP.objSides),a=R.rmM(dP.paintNmM),s=gC(dP.palettes,R.n(230,250)/a,"i",o,.1,!0),d=gC(dP.palettes,R.n(230,250)/a,"i",o+1,.1,!0),t=dP.grid[o].cP,n=R.rmM(dP.sWmM),i=e.min(dP.sW/3,e.min(dP.grid[o].w,dP.grid[o].h)),u=R.d(),l=R.d(),c=u<dP.prodDF,h=l<dP.prodDS,theObjects.push(new aP(r,s,d,n,c,t,i,P*(1+.1*R.dd()),R.rmM(dP.wKmM),r*R.rmM(dP.wKTmM),h,a))},e.drawRR=function(t){let s,d,r,n;e.push(),r=[R.c(Object.keys(pltLines))],dP.theLineColoursN=R.n(1,pltLines[r].length);let o,i=Math.sqrt();i=dP.lR;let a=a1=a2=a3=a4=!0;for(let t=0;t<dP.tLR.length-1;t++)if(0!=dP.ea||!R.b(dP.rndArr[45])){s=dP.tLR[t].sW,n=dP.tLR[t].oLK,d=R.i(20,150);for(let c=0;c<dP.tLR[t].numL;c++){for(let d=0;d<dP.lR;d++)e.push(),a=1==dP.ea||R.b(dP.rndArr[17]),a1=1==dP.ea||R.b(dP.rndArr[29]),a2=1==dP.ea||R.b(dP.rndArr[30]),a3=1==dP.ea||R.b(dP.rndArr[31]),a4=1==dP.ea||R.b(dP.rndArr[37]),e.strokeWeight(s*n*(.15+2*dP.rndArr[10]*e.sin(dP.rndArr[19]*(t+c)/20)+1.5*dP.rndArr[11]*e.cos(dP.rndArr[17]*(t+1.5*c)/30))),c>50&&c<70&&(tyty=!0),o=gC(r,e.constrain(c,0,dP.tLR[t].numL,100,dP.theLineT/i),"index",Math.floor(c)%dP.theLineColoursN,.1,!0,pltLines,1),e.stroke(o),e.line(dP.tLR[t].offset+a*c*s/dP.tLR[t].dd,dP.tLR[t].thePosH+a1*((dP.tLR[t+1].thePosH-dP.tLR[t].thePosH)*dP.lineStartK*R.d()),dP.lineSinK*(.25+e.cos(t*dP.rndArr[25]*dP.rndArr[33]))*e.sin(dP.rndArr[25]*(c/2+5+1*d/10)),dP.tLR[t].offset+a2*c*s/dP.tLR[t].dd+1*(dP.tLR[t+1].thePosH-dP.tLR[t].thePosH)*dP.tLR[t].inc,dP.tLR[t+1].thePosH*(1+.25*a3*R.dd()*dP.lineEndK),a4*dP.lineSinK*(.25+e.cos(t*dP.rndArr[25]*dP.rndArr[33]))*e.cos(dP.rndArr[25]*(c/2+5+1*d/11))),e.pop();(c+t)%d==0&&(r=[R.c(Object.keys(pltLines))],dP.theLineColoursN=R.n(1,pltLines[r].length))}}e.pop()},e.drawObjects=function(){for(let t=0;t<1;t++)e.push(),e.translate(2*R.dd(),2*R.dd(),2*R.dd()),e.drawRR(t),e.pop();e.push();for(let t=0;t<3;t++){e.translate(5*R.dd(),5*R.dd(),5*R.dd());for(let e=0;e<theObjects.length;e++)theObjects[e].draw(1,0)}e.pop()},e.setup=function(){if(window.p=e,R=new Random,fileNameBase="extranezas-",cV=e.createVector,(dP={}).gAR=.66,piAR=dP.gAR,e.windowWidth/e.windowHeight<=piAR?(dP.sW=e.windowWidth,dP.sH=e.windowWidth/piAR):(dP.sH=e.windowHeight,dP.sW=e.windowHeight*piAR),e.sAP(),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(dP.pd/=2,dP.pdA/=2,dP.pdC/=2,dP.pdD/=2),hC=/HeadlessChrome/.test(navigator.userAgent),e.pixelDensity(dP.pd),cnv=e.createCanvas(dP.sW,dP.sH,e.WEBGL),e.setAttributes({alpha:!0,premultipliedAlpha:!1}),sh=e.createShader(sh_vs,sh_fs),fboA=e.createFramebuffer({colorFormat:"float",preserveDrawingBuffer:!0,alpha:!0,premultipliedAlpha:!1}),fboC=e.createFramebuffer({colorFormat:"float",alpha:!0,premultipliedAlpha:!1}),fboD=e.createFramebuffer({colorFormat:"float",preserveDrawingBuffer:!0,alpha:!0,premultipliedAlpha:!1}),fboA.pixelDensity(dP.pd),fboC.pixelDensity(dP.pdB),fboD.pixelDensity(dP.pdC),e.smooth(),e.setupObjects(),e.loop(),fboA.draw(()=>{e.smooth(),e.translate(-dP.sW/2,-dP.sH/2),e.background(dP.bgC),e.drawObjects()}),fboC.draw(()=>{e.smooth(),e.translate(-dP.sW/2,-dP.sH/2);for(let t=0;t<dP.dLN;t++)e.drawRR(3*t)}),hC&&(dP.gameOn=!0),dP.gameOn){e.initgame();for(let t=0;t<dP.gameInitPos;t++)dP.gCDV=R.i(1,6),dP.gSDV=R.i(1,6),e.onePos()}document.body.style.margin=0,document.body.style.overflow="hidden",document.body.style.display="flex",document.body.style.justifyContent="center",document.body.style.alignItems="center",document.body.style.verticalAlign="center"},e.initgame=function(){e.ln=[],fboD.draw(()=>{e.clear(),e.resetMatrix(),e.push(),e.background(30,30,30),e.pop()}),dP.gamePosCount=0},e.onePos=function(t=!0){t&&fboD.draw(()=>{e.push(),e.translate(-dP.sW/2,-dP.sH/2),drawOne(t),e.pop(),e.loop()}),dP.gamePosCount++},e.shI=function(){e.shader(sh);let t=1+e.abs(e.sin(e.frameCount/10));dP.shBx=2.5*(-1)**e.frameCount*t,dP.shBy=2.5*(-1)**e.frameCount*t,sh.setUniform("tS",[dP.shT*(1+.25*R.d())/e.width*dP.shK,dP.shT*(1+.25*R.d())/e.height*dP.shK]),sh.setUniform("u_aB",dP.shAB),sh.setUniform("u_dir",[dP.shBx,dP.shBy]),sh.setUniform("u_time",e.millis()/1e3),sh.setUniform("u_pA",dP.shBlEqA),sh.setUniform("u_pB",dP.shBlEqB),sh.setUniform("u_pC",dP.shBlEqC),sh.setUniform("u_bw",1==dP.shBW),sh.setUniform("u_g",dP.shG),sh.setUniform("u_br",dP.shBr),sh.setUniform("u_con",dP.shCon),sh.setUniform("u_inv",dP.shInv),sh.setUniform("u_res",[dP.sW,dP.sH]),sh.setUniform("u_cK",Math.sqrt(dP.cK)),sh.setUniform("u_rndArr",dP.rndArr),sh.setUniform("o",dP.oT),sh.setUniform("gameOn",1==dP.gameOn)},e.draw=function(){if(e.push(),e.shI(),sh.setUniform("tex0",fboA.color),sh.setUniform("tex2",fboC.color),sh.setUniform("gtex",fboD.color),sh.setUniform("u_time",e.millis()),e.rect(-dP.sW/2,-dP.sH/2,dP.sW,dP.sH),e.pop(),2==e.frameCount){let e='You can interact with the piece. You can input commands by pressing keys in the keyboard, or set up the piece directly via the URL.\n\nKeyboard commands: press:\n\ns to save the current image\n\nv followed by 1,2,3 or 0 to see the different fragments that make up the whole piece. This piece uses 3 separate layers to compose the final image. You can see them with numbers 1,2 and 3, then use v 0 to see again the full, final result. If you press "s" at any moment, you will save the image you see (i.e., you can save all components of the artwork separately if you want)\n\nl to pause the piece. When paused, you will see a static image instead of the varying noise.\n\nIt has also colour controls: z for brightness, x for contrast, g for gamma, b for blur, n for noise followed by + or - (repeatedly if you want) to alter their values. You might get some simple variations that you might enjoy.\n\nAs stated, you can try to summon the piece to reveal its hidden _ game _ If you do, further instructions will be revealed in the browser console.\n\nURL parameters: in live view, you have to append the 1st parameter using ? instead of &, and the rest using & as indicated below\n\n&pd=N uses pixel density N to arbitrarily set the resolution. Go as high as your hardware allows you to. Nice for high resolution stills and if you intend to print.\n\n&oT=N with N being 1,2,3 or 0: sets the view of the desired component, or the final composed piece (it\'s 0 by default, no need to set that)\n\n&ea=0 tells the piece to skip certain instructions. It is 1 by default.\n\n&theSecretWayToSummonTheGame followed by "On" and equal 1: it shows the piece with the game on and also with some moves already made. For example, if the secret way to summon the game would be "learn", then the URL parameter would be &learnOn=1 (it\'s not learn... but surely a game is a way to learn)\n\n';console.clear(),console.log("extrañezas / marcelo soria-rodríguez @msoriaro 2023"),console.log("CC BY-NC-SA 4.0, https://creativecommons.org/licenses/by-nc-sa/4.0/"),console.log("uses p5js and p5.Framebuffer (MIT License) by Dave Pagurek (thanks so much)"),console.log("always try to find the little game in what you do"),console.log("for example, you can try to ask this piece for a game... the same way you introduce other commands (see below)... but a _game_... "),console.log(e),console.log("and thanks for inspecting the console!")}},e.ln=[],e.keyTyped=function(t){var s=new Date;if("s"==t.key)e.save(`extranezas_${tD.tokenId}_${tD.hash}_${s.toISOString()}.png`);else if("l"==t.key)dP.lp?e.noLoop():e.loop(),dP.lp=!dP.lp;else if("d"==t.key)dP.gCDV=R.i(1,4),dP.gSDV=R.i(1,6),e.onePos();else if("j"==t.key)e.onePos(!1);else if("r"==t.key)e.onePos(!0);else if("h"==t.key)for(let t=0;t<R.i(50,250);t++)dP.gCDV=R.i(1,6),dP.gSDV=R.i(1,6),e.onePos();let d=lt.slice(-1)[0];if(dP.gameOn&&-1!="123456789".indexOf(t.key)){if(e.ln.push(t.key),3==e.ln.length){dP.gSDV=e.int(e.ln[0]),dP.gCDV=e.int(e.ln[1]);for(let t=0;t<e.int(e.ln[2]);t++)e.onePos();e.ln=[]}}else"v"==d&&-1!="1230".indexOf(t.key)?dP.oT=e.int(t.key):"+"===t.key?("g"===d&&(dP.shG*=1.1),"z"===d&&(dP.shBr+=.03),"x"===d&&(dP.shCon*=1.1),"n"===d&&(dP.shBlEqC*=1.1),"m"===d&&(dP.shT*=1.1),"b"===d&&(dP.shBlEqA*=1.03,dP.shBlEqB/=1.025),"k"===d&&(dP.gOSK*=1.05),"w"===d&&(dP.gOWK*=1.05)):"-"===t.key?("g"===d&&(dP.shG/=1.1),"z"===d&&(dP.shBr-=.03),"x"===d&&(dP.shCon/=1.1),"n"===d&&(dP.shBlEqC/=1.1),"m"===d&&(dP.shT/=1.1),"b"===d&&(dP.shBlEqA/=1.03,dP.shBlEqB*=1.025),"k"===d&&(dP.gOSK/=1.05),"w"===d&&(dP.gOWK/=1.05)):lt.push(t.key);if("game"===lt.join("").slice(-4)){if(dP.gameOn)return;e.initgame(),dP.gameOn=!0,e.pi(),e.loop()}else"quit"===lt.join("").slice(-4)&&(e.initgame(),dP.gameOn=!1,e.loop())},e.pi=function(){g1&&(console.log('\n\n\n\nGreetings Professor Falken.\n\nHow about a nice game of creating your own piece rolling the dice?\n\nPress "d" to roll the dice two times: this will choose automatically a shape and a colour and draw the corresponding result.\n\nPress "h" to roll the dice a random number of times to create a random number of positions (like rolling a "h"eap of dices).\n\nYou can press "j" to jump a position without drawing anything.\n\nFinally, you can be in total control by choosing first the shape, then the colour and then the number of times you want that combination to be drawn. To do this, first press a number between 1 and 6 (chooses a shape), then a number between 1 and 9 (chooses a colour) then a number between 1 and 9 (repeats that combination the specified number of times).\n\nYou can also press "w" followed by + or - repeatedly to alter the line width of the shapes. You can also press "k" followed by + or - repeatedly to alter the scale factor of each shape size and position.\n\nTo clear your game, choose to _quit_ just like you summoned the _game_. You can enter into the _game_ again if you wish, doing the same thing you did to enter the 1st time.\n\nYou can display the piece directly in game mode appending the following parameters to the URL:\n\n&gameOn=1 to enable the game\n&gameInitPos=N to use N positions already randomly played. Go as high as you want with the number.\n\nIt\'s an exploration game. The only winning move is to learn. Much like in life.\n\n\n\n'),g1=0)}};new p5(sketch);