xxxxxxxxxx
86
let code = "a,b,c...z = Math.floor (random(width/2));\nstroke(y,o,u);\npoint(b,e);\nstroke(t,h,e);\npoint(w,e);\nstroke(b,a,d);\npoint(n,o);\nstroke(s,h,e);\npoint(o,h);\nstroke(e,a,t);\npoint(a,n);\nstroke(f,u,n);\npoint(o,k);\nstroke(a,n,d);\npoint(i,s);\nstroke(o,n,e);\npoint(i,n);\nstroke(b,u,t);\npoint(s,o);\nstroke(h,e,r);\npoint(o,n);\nstroke(w,a,s);\npoint(o,r);"
function setup() {
createCanvas(800, 400);
text(code,7*width/8-10,10,width/4-20,height);
a=Math.floor(random(width/2));
b=Math.floor(random(width/2));
c=Math.floor(random(width/2));
d=Math.floor(random(width/2));
e=Math.floor(random(width/2));
f=Math.floor(random(width/2));
g=Math.floor(random(width/2));
h=Math.floor(random(width/2));
i=Math.floor(random(width/2));
j=Math.floor(random(width/2));
k=Math.floor(random(width/2));
l=Math.floor(random(width/2));
m=Math.floor(random(width/2));
n=Math.floor(random(width/2));
o=Math.floor(random(width/2));
p=Math.floor(random(width/2));
q=Math.floor(random(width/2));
r=Math.floor(random(width/2));
s=Math.floor(random(width/2));
t=Math.floor(random(width/2));
u=Math.floor(random(width/2));
v=Math.floor(random(width/2));
w=Math.floor(random(width/2));
x=Math.floor(random(width/2));
y=Math.floor(random(width/2));
z=Math.floor(random(width/2));
noStroke();
text('1',b+10,e);
text('2',w+10,e);
text('3',n+10,o);
text('4',o+10,h);
text('5',a+10,n);
text('6',o+10,k);
text('7',i+10,s);
text('8',i+10,n);
text('9',s+10,o);
text('10',o+10,n);
text('11',o+10,r);
text('12',t+10,o);
}
function draw() {
// noStroke();
// background(255);
strokeWeight(1);
fill(0,0,0);
if (mouseIsPressed){
ellipse(width/2+mouseY,mouseX*cos(mouseX)*1.5,5*cos(5)*0.3,5);
line(pmouseX,pmouseY,mouseX,mouseY);
}
strokeWeight(4);
stroke(y,o,u);
point(b,e);
stroke(t,h,e);
point(w,e);
stroke(b,a,d);
point(n,o);
stroke(s,h,e);
point(o,h);
stroke(e,a,t);
point(a,n);
stroke(f,u,n);
point(o,k);
stroke(a,n,d);
point(i,s);
stroke(o,n,e);
point(i,n);
stroke(b,u,t);
point(s,o);
stroke(h,e,r);
point(o,n);
stroke(w,a,s);
point(o,r);
stroke(t,o,o);
point(t,o);
}