memoscan
← all memos

Memo 0x1358bb69…370f4a on Ethereum

const hashPairs=[];for(let e=0;e<32;e++)hashPairs.push(tokenData.hash.slice(2+2*e,4+2*e));const dcP=hashPairs.map((e=>parseInt(e,16))),seed=parseInt(tokenData.hash.slice(2,10),16);class Random{constructor(){this.useA=!1;let e=function(e){let l=parseInt(e.substring(0,8),16),r=parseInt(e.substring(8,16),16),f=parseInt(e.substring(16,24),16),o=parseInt(e.substring(24,32),16);return function(){l|=0,r|=0,f|=0,o|=0;let e=(l+r|0)+o|0;return o=o+1|0,l=r^r>>>9,r=f+(f<<3)|0,f=f<<21|f>>>11,f=f+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substring(2,32)),this.prngB=new e(tokenData.hash.substring(34,64));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}r_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}r_num(e,l){return e+(l-e)*this.r_dec()}r_int(e,l){return Math.floor(this.r_num(e,l+1))}r_bool(e){return this.r_dec()<e}r_choice(e){return e[this.r_int(0,e.length-1)]}r_float(e,l){return Math.random()*(l-e)+e}}let R=new Random(seed);class SquarePacking{constructor(e,l){this.containerSize=e,this.squareSizes=[...l],this.packedSquares=[],this.container={x:0,y:0,size:e,shape:null,col:null}}pack(){this.packedSquares=[];const e=this.shuffleArray(this.squareSizes);return this.packSquares(this.container,e),this.packedSquares}packSquares(e,l){let r=0,f=0;for(;r<e.size**2&&f<2*e.size**3;){let o=R.r_choice(l);o=f>e.size**2/2?1:o;const t=this.findPosition(e,o);if(t){const f={x:t.x,y:t.y,size:o,shape:R.r_int(0,34)};this.packedSquares.push(f),r+=o**2;const s={x:e.x+t.x,y:e.y+t.y,size:o};this.packSquares(s,l)}f++}}findPosition(e,l){const{x:r,y:f,size:o}=e,t=o-l+1,s=o-l+1;let n=R.r_int(0,t)+f,a=R.r_int(0,s)+r;for(let e=n;e<=f+o-l;e++){for(let f=a;f<=r+o-l;f++)if(this.isPositionAvailable(f,e,l))return{x:f,y:e};a=r}return null}isPositionAvailable(e,l,r){for(let f=0;f<this.packedSquares.length;f++){const o=this.packedSquares[f];if(e<o.x+o.size&&e+r>o.x&&l<o.y+o.size&&l+r>o.y)return!1}return!0}shuffleArray(e){for(let l=e.length-1;l>0;l--){const r=Math.floor(R.r_num()*(l+1));[e[l],e[r]]=[e[r],e[l]]}return e}}function shuffleArray(e){for(let l=e.length-1;l>0;l--){let r=Math.floor(R.r_num()*(l+1));[e[l],e[r]]=[e[r],e[l]]}return e}let rows=[5,7,8,8,8,9,9,9,11,12,13,17,19];bdstr=(e,l)=>{const r=R.r_dec(),f=R.r_dec(),o=Math.pow(r,1/e);return o/(o+Math.pow(f,1/l))};let chosenSize=rows[Math.floor(bdstr(3,4)*rows.length)];const grdSz=cntSz=chosenSize;let mxm=Math.floor(cntSz/2);function randomizeSquareSizes(){let e,l=[];for(let r=0;r<12;r++)e=R.r_int(20,255)<dcP[20]?R.r_int(1,mxm):1,l.push(e);return l}let poly,dots,sqrSzsArr=randomizeSquareSizes(),bloques=[],centro=new SquarePacking(2*cntSz,sqrSzsArr);bloques.push(centro.pack());for(let e=0;e<8;e++){let e=new SquarePacking(cntSz,sqrSzsArr).pack();bloques.push(e)}let ww,wh,wmaj,wmin,rt,cw,ch,uc,fr,bgCol,PALETTE_BCKGR=[],chosen_palette=[],palettes=[];palettes=[{name:"Buena Vida",colors:["ff87ff","ec00ff","000000","aabbe2","0000ff","ff8d29","468500","cee9c8","3511d6","ffffff","7a2ada","ff0000","c6ec26","ffcd38","f9dac3"]},{name:"Portals",colors:["ffcd38","7a2bdb","29369f","ff88fe","000000"]},{name:"B&W",colors:["000000","ffffff"]},{name:"Red & Black",colors:["ff0000","000000"]},{name:"Orange Red",colors:["ff0000","ff8d29","ffffff","000000"]},{name:"Gray",colors:["000000","848484","bbbbbb","ffffff"]},{name:"Vibrant Sunset",colors:["ffcd38","ff88fe","ff0000"]},{name:"Vibrant Rhapsody",colors:["ff88fe","0000ff","ffffff","ffcd38"]},{name:"Fiery Fusion",colors:["ff88fe","0000ff","f66a04","ffcd38"]},{name:"Harmony in Blue",colors:["ff0000","aabbe2","ffffff","3511d6"]},{name:"Soothing Serenity",colors:["ff87ff","7a2ada","000000","ec00ff"]},{name:"Pop",colors:["c6ec26","000000","ffffff","ffcd38"]},{name:"Subtle Elegance",colors:["ff87ff","ffcd38","ff0000","ffffff"]},{name:"Twilight Hues",colors:["3511d6","aabbe2","000000","ffffff"]},{name:"Cosmic Energy",colors:["F3F2DA","4E8D7C","2535a5","EA97AD"]},{name:"Calmness",colors:["ffffff","bbbbbb","D2E603","EFF48E"]},{name:"Rustic Charm",colors:["000000","ffcd38","aabbe2","ffffff"]},{name:"Insightful",colors:["000000","ff0000","ff87ff","0000ff"]},{name:"Harmony",colors:["ffcd38","0000ff","000000","ff8d29"]},{name:"Polarity",colors:["ff87ff","468500"]},{name:"Growth",colors:["000000","ffcd38"]},{name:"Urban Pop",colors:["c6ec26","3511d6","aabbde"]},{name:"Red & Cream",colors:["f9dac3","ff0000"]},{name:"Spiritual Freedom",colors:["ffffff","ec00ff","468500"]},{name:"Authonomy",colors:["ff0000","ffcd38","ffffff","0000ff","468500"]},{name:"Sources",colors:["3511d6","eb87ff","ffcd38","aabbde","ff0000"]},{name:"Enigmatic Noir",colors:["3511d6","eb87ff","ffcd38","aabbde"]},{name:"Blissful Coral",colors:["ffcd38","e998a7","e45c63","f3bcc4","9aad8d"]},{name:"Emerald Oasis",colors:["4b9889","11927a","f4cb85","385c55","efe5c1"]},{name:"Dreamy Lilac",colors:["7e4f83","969cd2","e8b8ce","f4c0ad","d388c5","ef998c"]},{name:"Catharsis",colors:["6c81c2","f3b8d2","b59dba","ffcd38","ffffff","e76046"]},{name:"Opposites",colors:["e3923d","915062","5c372b","e36448","d7c787","dd83a5","324378","ffffff"]},{name:"Merging",colors:["398257","ffcd38","ffffff","edb978","dd7f6e","3b529a"]},{name:"Sun-kissed Sands",colors:["ffffff","f3b5e1","ef986c","d1c65e","766662","91a07a","f3b440","ffcd38","b3dad2"]},{name:"Cherry Blossom",colors:["ac5e9d","54104e","c4a5bd","ffffff","ad3275","ecb0a4","cf513f","ff0000"]},{name:"Sisterhood",colors:["232f6d","bf9dc5","696da5","405c9b"]},{name:"Mision",colors:["405c9b","f8d886","3c878a","eec78b"]},{name:"Subtle Elegance",colors:["474883","c53432","000000","ffffff","e5bfd4"]},{name:"Childlike",colors:["e8723f","b53e73","ffcd38","9ec9d2","408e5a","dea9b7","2e68bb","34489e"]}];let paleta=palettes[dcP[0]%palettes.length],boxed=dcP[5]>180,anim=dcP[6]>70,dir=dcP[7]%2==0?"h":"v";dir=dcP[7]>200?"c":dir;let vel=dcP[10]%3*15+10;function pObj_a_pArr(e){let l=[];return e.colors.forEach((e=>{l.push(color("#"+e))})),l}function framer(e,l){let r={w:0,h:0,f:"q",mn:0},f=e<l?e:l,o=e/l;return o>=1.5?(r.f="h",r.o=0,r.e=16,o>=16/9?(r.h=l/9*7,r.w=2*r.h):(r.w=e/16*14,r.h=r.w/2),r.m=r.h/8):o<=2/3?(r.f="v",r.n=0,r.s=16,o<=9/16?(r.w=e/9*7,r.h=2*r.w):(r.h=l/16*14,r.w=r.h/2),r.m=r.w/8):(r.w=r.h=f/9*7,r.m=r.w/8),r.mn=r.w<r.h?r.w:r.h,r}function setup(){noiseSeed(seed+2),noiseDetail(10,.1),chosen_palette=pObj_a_pArr(paleta);let e=chosen_palette.splice(R.r_int(0,chosen_palette.length-1),1);bgColor=e[0],ww=innerWidth,wh=innerHeight,rt=ww/wh,wmin=ww<wh?ww:wh,wmaj=ww<wh?wh:ww,fr=framer(ww,wh),uc=wmin/100,createCanvas(ww,wh),pixelDensity(2),noStroke(),rectMode(CORNERS),background(bgColor);let l={x:(ww-fr.mn)/2,y:(wh-fr.mn)/2};drawCells(bloques[0],l),"v"==fr.f&&(l={x:(ww-fr.w)/2,y:(wh-fr.h)/2},drawCells(bloques[1],l),l={x:ww/2,y:(wh-fr.h)/2},drawCells(bloques[2],l),l={x:(ww-fr.w)/2,y:wh/2+fr.mn/2},drawCells(bloques[3],l),l={x:ww/2,y:wh/2+fr.mn/2},drawCells(bloques[4],l)),"h"==fr.f&&(l={x:(ww-fr.w)/2,y:(wh-fr.h)/2},drawCells(bloques[5],l),l={x:(ww-fr.w)/2,y:wh/2},drawCells(bloques[6],l),l={x:ww/2+fr.mn/2,y:(wh-fr.h)/2},drawCells(bloques[7],l),l={x:ww/2+fr.mn/2,y:wh/2},drawCells(bloques[8],l)),!0!==anim||!0!==boxed?noLoop():frameRate(vel)}function draw(){if(boxed){let e={x:(ww-fr.mn)/2,y:(wh-fr.mn)/2};drawAnimatedCells(bloques[0],e),"v"==fr.f&&(e={x:(ww-fr.w)/2,y:(wh-fr.h)/2},drawAnimatedCells(bloques[1],e),e={x:ww/2,y:(wh-fr.h)/2},drawAnimatedCells(bloques[2],e),e={x:(ww-fr.w)/2,y:wh/2+fr.mn/2},drawAnimatedCells(bloques[3],e),e={x:ww/2,y:wh/2+fr.mn/2},drawAnimatedCells(bloques[4],e)),"h"==fr.f&&(e={x:(ww-fr.w)/2,y:(wh-fr.h)/2},drawAnimatedCells(bloques[5],e),e={x:(ww-fr.w)/2,y:wh/2},drawAnimatedCells(bloques[6],e),e={x:ww/2+fr.mn/2,y:(wh-fr.h)/2},drawAnimatedCells(bloques[7],e),e={x:ww/2+fr.mn/2,y:wh/2},drawAnimatedCells(bloques[8],e))}}function doTriangle(e,l,r,f,o,t,s,n=1){angleMode(RADIANS);let a=[];if(noStroke(),"d"==t&&(a.push({x:e,y:l}),a.push({x:r,y:l}),a.push({x:e+o/2,y:f})),"u"==t&&(a.push({x:r,y:f}),a.push({x:e,y:f}),a.push({x:e+o/2,y:l})),"l"==t&&(a.push({x:r,y:f}),a.push({x:e,y:l+o/2}),a.push({x:r,y:l})),"r"==t&&(a.push({x:e,y:l}),a.push({x:r,y:l+o/2}),a.push({x:e,y:f})),noStroke(),triangle(a[0].x,a[0].y,a[1].x,a[1].y,a[2].x,a[2].y),!s){angleMode(RADIANS),pts=insets(a,n),fill(bgColor),beginShape();for(let e of pts)vertex(e.x,e.y);endShape(CLOSE),stroke(50,60),strokeWeight(.8),noFill()}}function drawCells(e,l){boxed&&drawSquares(e,l);let r=fr.mn/(2*grdSz),f=.08*r;for(let o=0;o<e.length;o++){let t=e[o],s=t.x*r+f/2+l.x,n=t.y*r+f/2+l.y;doShape(t,s,n,s+t.size*r-f,n+t.size*r-f)}}function drawAnimatedCells(e,l){let r=fr.mn/(2*grdSz),f=.08*r;for(let o=0;o<e.length;o++){let t=e[o],s=t.x*r+f/2+l.x,n=t.y*r+f/2+l.y,a=s+t.size*r-f,i=n+t.size*r-f,c=(s+a)/2,h=(n+i)/2,d=Math.floor(80*dist(c,h,ww/2,wh/2)/fr.mn);if("h"==dir&&(d=Math.floor(40*dist(c,c,ww/2,ww/2)/fr.mn)),"v"==dir&&(d=Math.floor(40*dist(h,h,wh/2,wh/2)/fr.mn)),frameCount%80==d){colorMode(HSL,1);let e=bgColor;strokeWeight(f),stroke(bgColor),fill(bgColor),rect(s,n,a,i);let l=lightness(e)<.2?1:-1;fill(hue(e)+l*R.r_dec()/30,saturation(e)-l*R.r_dec()/10,lightness(e)+l*R.r_dec()/5),noStroke(),rect(s,n,a,i),colorMode(RGB),doShape(t,s,n,a,i)}}}function drawSquares(e,l){mod=fr.mn/(2*grdSz);for(let r=0;r<e.length;r++){let f=e[r],o=f.x*mod+1+l.x,t=f.y*mod+1+l.y,s=o+f.size*mod-2,n=t+f.size*mod-2;colorMode(HSL,1);let a=bgColor,i=lightness(a)<.2?1:-1;fill(hue(a)+i*R.r_dec()/30,saturation(a)-i*R.r_dec()/10,lightness(a)+i*R.r_dec()/5),noStroke(),rect(o,t,s,n),colorMode(RGB)}}function drawTarget(e,l,r,f){const o=r/f;for(let t=0;t<f;t++)fill(R.r_choice(chosen_palette)),ellipse(e,l,r-t*o,r-t*o)}function doShape(e,l,r,f,o){let t=e.shape,s=(f+l)/2,n=(o+r)/2,a=(ww/2-s)/fr.mn,i=(wh/2-n)/fr.mn,c=Math.floor(dist(s,n,ww/2,wh/2)/fr.mn*10),h=dcP[8]/4;R.r_dec()>dcP[8]/256&&(t=Math.floor(34*noise(a*h,i*h))+4*c,t=t>34?t-34:t);let d=R.r_choice(chosen_palette),w=colWidth=cllSz=Math.abs(f-l),u=cllSz/16,m=(e.size,cllSz/8);if(0==t)noStroke(),fill(d),rect(l,r,f,o);else if(1==t){noFill(),stroke(d),strokeCap(SQUARE),strokeWeight(u);let e=w/6,o=r+w/2;for(let r=0;r<5;r++)line(l,o+(r-2)*e,f,o+(r-2)*e)}else if(2==t)noStroke(),fill(d),strokeCap(SQUARE),arc((l+f)/2,(r+o)/2,colWidth,w,PI,TWO_PI);else if(3==t)noStroke(),drawTarget((l+f)/2,(r+o)/2,colWidth,R.r_int(3,7));else if(4==t)noStroke(),fill(d),doTriangle(l,r,f,o,cllSz,"d",!0,u);else if(5==t)stroke(d),strokeWeight(u),strokeCap(SQUARE),line(l+u,r+u,f-u,o-u);else if(6==t)stroke(d),strokeWeight(u),strokeCap(SQUARE),line(l+u,o-u,f-u,r+u);else if(7==t)noStroke(),drawTarget((l+f)/2,(r+o)/2,colWidth,R.r_int(2,4));else if(8==t)noStroke(),fill(d),arc((l+f)/2,(r+o)/2,colWidth,w,0,PI);else if(9==t)noFill(),stroke(d),strokeWeight(u),strokeCap(SQUARE),arc((l+f)/2,(r+o)/2,colWidth-u,w-u,0,HALF_PI);else if(10==t)noStroke(),fill(d),arc((l+f)/2,(r+o)/2,colWidth,w,2*PI,PI/2);else if(11==t)noStroke(),fill(d),arc((l+f)/2,(r+o)/2,colWidth,w,HALF_PI,-HALF_PI);else if(12==t)noStroke(),fill(d),arc((l+f)/2,(r+o)/2,colWidth,w,PI/2,PI);else if(13==t)noStroke(),fill(d),arc((l+f)/2,(r+o)/2,colWidth,w,PI,PI/2*3);else if(14==t)noStroke(),fill(d),arc((l+f)/2,(r+o)/2,colWidth,w,0,PI/2);else if(15==t)noStroke(),fill(d),arc((l+f)/2,(r+o)/2,colWidth,w,PI/2*3,2*PI);else if(16==t)noStroke(),fill(d),arc((l+f)/2,r+w/2,colWidth,w,HALF_PI,-HALF_PI);else if(17==t)noStroke(),fill(d),arc((l+f)/2,o-w/2,colWidth,w,-HALF_PI,HALF_PI);else if(18==t){noFill(),stroke(d),strokeWeight(u),strokeCap(SQUARE);let e=colWidth/7,f=l+(colWidth-7*e)/2+e/2;for(let l=0;l<7;l++)line(f+l*e,r,f+l*e,o)}else if(19==t){noFill(),stroke(d),strokeWeight(u);let e=min(colWidth,w)/4,f=l+colWidth/2;ellipse(f,r+w/2,e,e)}else if(20==t)noFill(),stroke(d),strokeWeight(u),strokeCap(SQUARE),arc(l,r,cllSz,cllSz,0,HALF_PI);else if(21==t)noFill(),stroke(d),strokeWeight(u),strokeCap(SQUARE),arc(f,r,cllSz,cllSz,HALF_PI,PI);else if(22==t)noFill(),stroke(d),strokeWeight(u),strokeCap(SQUARE),arc(l,o,cllSz,cllSz,PI+HALF_PI,TWO_PI);else if(23==t)noFill(),stroke(d),strokeWeight(u),strokeCap(SQUARE),arc(f,o,cllSz,cllSz,PI,PI+HALF_PI);else if(24==t)fill(d),doTriangle(l,r,f,o,cllSz,"l",!0,u);else if(25==t)fill(d),doTriangle(l,r,f,o,cllSz,"u",!0,u);else if(26==t)fill(d),doTriangle(l,r,f,o,cllSz,"r",!0,u);else if(27==t){noStroke(),fill(d);colWidth;for(let e=0;e<5;e++){let f=l+cllSz/5*(e+.5),o=r+cllSz/5*(e+.5);ellipse(f,o,m,m)}}else if(28==t){noStroke(),fill(d);let e=(colWidth-5*m)/6;for(let f=0;f<5;f++){circle(l+(f+1)*e+f*m+m/2,r+w/2,m)}}else if(29==t){noStroke(),fill(d);colWidth;for(let e=0;e<5;e++){let r=l+cllSz/5*(e+.5),f=o-cllSz/5*(e+.5);ellipse(r,f,m,m)}}else if(30==t){noStroke(),drawTarget((l+f)/2,(r+o)/2,colWidth-0,R.r_int(3,7))}else 31==t?(fill(d),doTriangle(l,r,f,o,cllSz,"d",!1,u)):32==t?(fill(d),doTriangle(l,r,f,o,cllSz,"u",!1,u)):33==t?(fill(d),doTriangle(l,r,f,o,cllSz,"r",!1,u)):(fill(d),doTriangle(l,r,f,o,cllSz,"l",!1,u))}function cruce(e,l,r,f){const o=((f.x-r.x)*(e.y-r.y)-(f.y-r.y)*(e.x-r.x))/((f.y-r.y)*(l.x-e.x)-(f.x-r.x)*(l.y-e.y));return[e.x+o*(l.x-e.x),e.y+o*(l.y-e.y)]}function insets(e,l){let r=[],f=[],o=[],t=0;for(let o of e){let s=e[(t+1)%e.length],n=createVector(s.x-o.x,-1*(s.y-o.y));n=n.normalize().rotate(HALF_PI).setMag(l);let a=n.copy().normalize().setMag(2*l);r.push([{x:o.x-n.x,y:o.y+n.y},{x:s.x-n.x,y:s.y+n.y}]),f.push([{x:o.x-a.x,y:o.y+a.y},{x:s.x-a.x,y:s.y+a.y}]),t++}t=0;for(let e of r){let l=r[(t+1)%r.length],f=cruce(e[0],e[1],l[0],l[1]);o.push({x:f[0],y:f[1]}),t++}return o}keyPressed=()=>{"s"===key&&save(tokenData.hash)};