xxxxxxxxxx
60
function setup() {
createCanvas(500, 600);
}
function draw() {
background(0);
stroke(255);
//vertical lines
stroke('red');
for (let x = 400; x < width-10; x = x + 5) {
line(x, 200, x, 500);
}
stroke('blue');
for(let x1 = 40; x1 < width-400; x1 = x1 + 2){
line(x1, 40, x1, 200);
}
stroke('green');
for(let x2 = 150; x2 < width-200; x2 = x2 + 6){
line(x2, 450, x2, 590);
}
stroke('pink');
for(let x3 = 255; x3 < width-150; x3 = x3 + 8){
line(x3, 100, x3, 330);
}
stroke('purple');
for(let x4 = 90; x4 < width-300; x4 = x4 + 1){
line(x4, 370, x4, 500);
}
stroke('red');
for (let x5 = 70; x5 < width-200; x5 = x5 + 10){
line(x5, 170, x5, 220);
}
//horizontal lines
stroke('yellow');
strokeWeight(3);
for(let y = 20; y < height-350; y = y + 15){
line(200, y, 300, y);
}
stroke('white');
strokeWeight(1);
for(let y1 = 315; y1 < height-50; y1 = y1 + 3){
line(70, y1, 170, y1);
}
stroke('grey');
for(let y2 = 40; y2 < height-250; y2 = y2 + 1){
line(390, y2, 430, y2);
}
stroke('blue');
for(let y3 = 275; y3 < height-70; y3 = y3 + 2){
line(280, y3, 450, y3);
}
print(mouseX, mouseY);
}