Square Puzzle
Square Puzzle
var c1,c2,c3;
var x=[];
var y=[];
var c=[];
var k;
var l=0;
function setup() {
createCanvas(300, 300);
k=0;
r=color(255,80,80);
g=color(100,240,100);
y=color(250,250,20);
c=[];
for(let i=0;i<width;i=i+width/3){
for(let j=0;j<height; j=j+height/3){
x[k]=j;
y[k]=i;
console.log(x,y);
k=k+1;
}
}
console.log(c);
}
function draw() {
background(220);
for(let m=0;m<9;m++){
fill(c[m]);
rect(x[m],y[m],width/3,height/3);
}
function mousePressed(){