JavaScript,680个字节
好吧,我已经完成了原始比赛的比赛,该比赛的规则发生了很大的变化。这绝对不是您能想到的最短的代码。它是为人气竞赛而设计的,并且逐像素创建了原始的图标图标。它还具有更多功能。:)
f=c=>{x=(d=document).body.appendChild(d.createElement`canvas`).getContext`2d`;if(c.b)x.scale(4,4);x.fillStyle=c.m?'#2d2d2d':'#62b0df';x.fillRect(0,0,16,16);x.fillStyle='#fff';for(i=0;i<(w=[0,0,1,0,14,0,15,0,0,11,15,11,0,12,1,12,14,12,15,12,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,11,13,12,13,13,13,14,13,15,13,0,14,1,14,2,14,3,14,4,14,5,14,6,14,7,14,10,14,11,14,12,14,13,14,14,14,15,14,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,1,4,2,4,3,4,7,4,8,4,12,4,13,4,14,4,1,5,4,5,6,5,9,5,11,5,1,6,2,6,3,6,6,6,11,6,13,6,14,6,1,7,6,7,9,7,11,7,14,7,1,8,7,8,8,8,12,8,13,8,]).length;i++)(t=a=>setTimeout(_=>x.fillRect(w[a++],w[a++],1,1),(c.a||0)*i))(i++)}
您最多可以使用三个参数来调用该函数:
f({});
f({m:true});
f({b:true});
f({a:50});
f({m:true,b:true,a:50});
m
变成meta并相应地更改颜色。如果您发现它很小,可以使用b
它从16x16px扩大到64x64px。最后a
将徽标动画化,就像刻在一块蓝板上一样。该值是每个动画步骤的速度。
不打高尔夫球
f=c=>{
x=(d=document).body.appendChild(d.createElement`canvas`).getContext`2d`;
if (c.b) x.scale(4,4);
x.fillStyle = c.m?'#2d2d2d':'#62b0df';
x.fillRect(0,0,16,16);
x.fillStyle='#fff';
for(i=0;i<(w=[0,0,1,0,14,0,15,0,0,11,15,11,0,12,1,12,14,12,15,12,0,13,1,13,2,13,3,13,4,13,5,13,6,13,7,13,11,13,12,13,13,13,14,13,15,13,0,14,1,14,2,14,3,14,4,14,5,14,6,14,7,14,10,14,11,14,12,14,13,14,14,14,15,14,0,15,1,15,2,15,3,15,4,15,5,15,6,15,7,15,9,15,10,15,11,15,12,15,13,15,14,15,15,15,1,4,2,4,3,4,7,4,8,4,12,4,13,4,14,4,1,5,4,5,6,5,9,5,11,5,1,6,2,6,3,6,6,6,11,6,13,6,14,6,1,7,6,7,9,7,11,7,14,7,1,8,7,8,8,8,12,8,13,8,]).length;i++)
(t=a=>setTimeout(_=>x.fillRect(w[a++],w[a++],1,1),(c.a||0)*i)
)(i++);
}
输出量
默认
动画的