script

Contract variable

Slot
0x000000000000000000000000000000000000000000000000000000000000001e
Offset
0
Type
string
Value
class Random{constructor(e){this.seed=e}random_dec(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}random_between(e,a){return e+(a-e)*this.random_dec()}random_int(e,a){return Math.floor(this.random_between(e,a+1))}random_choice(e){return e[Math.floor(this.random_between(0,.99*e.length))]}random_exp(e,a,n){return floor(map(Math.exp(map(this.random_between(0,999),0,1e3,0,n)),Math.exp(0),Math.exp(n),e,a+1))}}function hue2rgb(e,a,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(a-e)*n:n<.5?a:n<2/3?e+(a-e)*(2/3-n)*6:e}function changeHue(e,a,n,r){var t=rgbToHSL(e,a,n);return t.h+=r,t.h>360?t.h-=360:t.h<0&&(t.h+=360),hslToRGB(t)}function rgbToHSL(e,a,n){e/=255,a/=255,n/=255;var r=Math.max(e,a,n),t=Math.min(e,a,n),o=r-t,i=(r+t)/2;return{h:0==o?0:r==e?(a-n)/o%6*60:r==a?60*((n-e)/o+2):60*((e-a)/o+4),s:0==o?0:o/(1-Math.abs(2*i-1)),l:i}}function hslToRGB(e){var a,n,r,t=e.h,o=e.s,i=e.l,m=(1-Math.abs(2*i-1))*o,s=m*(1-Math.abs(t/60%2-1)),d=i-m/2;return t<60?(a=m,n=s,r=0):t<120?(a=s,n=m,r=0):t<180?(a=0,n=m,r=s):t<240?(a=0,n=s,r=m):t<300?(a=s,n=0,r=m):(a=m,n=0,r=s),[a=normalize_rgb_value(a,d),n=normalize_rgb_value(n,d),r=normalize_rgb_value(r,d)]}function normalize_rgb_value(e,a){return(e=Math.floor(255*(e+a)))<0&&(e=0),e}function hueShift(e,a){e.loadPixels();for(var n=0;n<e.pixels.length;n+=4){let r=changeHue(e.pixels[n],e.pixels[n+1],e.pixels[n+2],a);e.pixels[n]=r[0],e.pixels[n+1]=r[1],e.pixels[n+2]=r[2]}e.updatePixels()}function componentToHex(e){var a=e.toString(16);return 1==a.length?'0'+a:a}const rgbtohex=(e,a,n)=>'#'+componentToHex(e)+componentToHex(a)+componentToHex(n);let tokenData=window.tokenHash,seed=parseInt(tokenData.slice(0,16),16),rng=new Random(seed);var SIZE;let glicpixxxOrigin=window.glicpixxxOrigin,filenames=window.imagesList.split(',');var images=[];let params={},oncee=!1;function preload(){for(let e in filenames)images.push(loadImage(filenames[e]))}function setup(){params.GRIDS=rng.random_exp(1,16,2),params.DRAW_MODE=rng.random_exp(1,6,2),params.IMAGE_FILTER=rng.random_exp(0,7,2),5!=params.IMAGE_FILTER&&6!=params.IMAGE_FILTER||(params.HUE_DEGREE=rng.random_int(1,360)),params.ROTATE_MODE=rng.random_exp(0,3,1.5),1==params.ROTATE_MODE?params.ROTATE_N=[...new Set(Array.apply(0,new Array(rng.random_int(1,4))).map(e=>rng.random_int(1,45)))]:2!=params.ROTATE_MODE&&3!=params.ROTATE_MODE||(params.ROTATE_N=rng.random_int(1,45)),params.bgcolor=rgbtohex(rng.random_int(0,255),rng.random_int(0,255),rng.random_int(0,255)),SIZE=Math.min(window.innerHeight,window.innerWidth),createCanvas(SIZE,SIZE),background(params.bgcolor)}function draw(){noSmooth(),mouseIsPressed?frameRate(map(mouseX,0,SIZE,5,60,!0)):frameRate(60);let e=width/params.GRIDS;angleMode(DEGREES),rot=0;for(let a=0;a<params.GRIDS;a++)for(let n=0;n<params.GRIDS;n++){let r=rng.random_choice(images);rotateMe(params.ROTATE_MODE,params.ROTATE_N),applyFilter(params.IMAGE_FILTER,r),DRAW_MODE(params.DRAW_MODE,r,e,n,a)}}function DRAW_MODE(e,a,n,r,t){switch(e){case 1:imageMode(CENTER),image(a,n*r+n/2,n*t+n/2,rng.random_between(0,n),rng.random_between(0,n));break;case 2:imageMode(CORNER),image(a,n*r,n*t,rng.random_between(0,n),rng.random_between(0,n));break;case 3:imageMode(CORNERS),image(a,n*r+rng.random_between(0,n),n*t+rng.random_between(0,n),n*r+rng.random_between(0,n),n*t+rng.random_between(0,n));break;case 4:imageMode(CENTER),image(a,n*r+rng.random_between(0,n),n*t+rng.random_between(0,n),n*r+rng.random_between(0,n),n*t+rng.random_between(0,n));break;case 5:imageMode(CORNER),image(a,n*r+rng.random_between(0,n),n*t+rng.random_between(0,n),n*r+rng.random_between(0,n),n*t+rng.random_between(0,n));break;case 6:imageMode(CORNERS),image(a,rng.random_between(0,SIZE),rng.random_between(0,SIZE),rng.random_between(0,SIZE),rng.random_between(0,SIZE))}}function applyFilter(e,a,n){switch(e){case 1:0==oncee&&(a.filter(INVERT),oncee=!0);break;case 2:a.filter(INVERT);break;case 3:a.filter(POSTERIZE,4);break;case 4:a.filter(POSTERIZE,2),a.filter(INVERT);break;case 5:0==oncee&&(hueShift(a,params.HUE_DEGREE),oncee=!0);
Size
32 bytes
Last txn
0xddc7eedf14f5c6879b7785588d6f731777f4b90d76eadd2356849638392c6b1a
14061943
-- to "Berk aka Princess Camel aka Guerilla Pimp Minion God Bastard"