0x1b9bb765…08c2sent to0xf38d6bf3…4ea6·#13,112,568·view on Etherscan
function render(t,e,l,i,n,o){const r=e.length;let c=Math.ceil(r*Math.SQRT2);const h=((c+=c%2)-r)/2;t.width=c*l,t.height=c*l;const f=t.getContext("2d");if(!f)throw new Error;f.fillStyle=o,f.fillRect(0,0,t.width,t.height),f.translate(h*l,h*l);for(let t=0;t<e.length;t++){const o=e[t];for(let c=0;c<o.length;c++){if(1==o[c])f.fillStyle=i;else{if(!(countNeighbors(e,c,t)>0))continue;f.fillStyle=n}f.fillRect(c*l,t*l,l,l),f.fillRect((r-c-1)*l,t*l,l,l)}}return t}function countNeighbors(t,e,l){var i,n;return((null===(i=t[l-1])||void 0===i?void 0:i[e])||0)+((null===(n=t[l+1])||void 0===n?void 0:n[e])||0)+(t[l][e-1]||0)+(t[l][e+1]||0)}