xxxxxxxxxx
94
let x1, x2, y1, y2;
let p1, p2, p3, p4;
function setup() {
createCanvas(600, 600);
frameRate(8);
}
function draw() {
background(255);
for (i = 0; i < 80; i++) {
x1 = random(0, 300);
x2 = random(0, 300);
y1 = random(300, 600);
y2 = random(300, 600);
// p1 = random(50);
p1 = 50;
// p2 = random(50, 100);
// p3 = random(100, 150);
// p4 = random(150, 200);
// p5 = random(200, 250);
// p6 = random(250, 300);
strokeWeight(3);
// gornji levi
for(let j = 0; j < 6; j++) {
let r1 = 0 + (j * 50);
let r2 = 50 + (j * 50);
line(random(r1, r2), random(r1, r2),
random(r1, r2), random(r1, r2));
}
// line(random(p1), random(p1), random(p1), random(p1));
// line(random(50, 100),
// random(50, 100),
// random(50, 100),
// random(50, 100));
// line(
// random(100, 150),
// random(100, 150),
// random(100, 150),
// random(100, 150)
// );
// line(
// random(150, 200),
// random(150, 200),
// random(150, 200),
// random(150, 200)
// );
// line(
// random(200, 250),
// random(200, 250),
// random(200, 250),
// random(200, 250)
// );
// line(
// random(250, 300),
// random(250, 300),
// random(250, 300),
// random(250, 300)
// );
noFill();
strokeWeight(2);
stroke(random(255), random(200), random(150));
rect(x1, x2, 10);
// donji desni
fill(random(255), random(200), random(150));
strokeWeight(4);
rect(y1, y2, 20);
noFill();
strokeWeight(1);
rect(y1, y2, 50);
// donji levi
strokeWeight(5);
line(x2, y2, x1, y2);
strokeWeight(2);
line(x1, y1, x2, y1);
// gornji desni
strokeWeight(1.5);
line(y1, x1, y2, x2);
}
}