xxxxxxxxxx
19
let lines = [];
const NUM_LINES = 100;
function setup() {
createCanvas(400, 400);
for (let i = 0; i < NUM_LINES; i += 1) {
// lines[i] = random(0, 255);
lines[i] = 255*abs(cos(i*0.1));
}
}
function draw() {
background(255);
for (let i = 0; i < NUM_LINES; i += 1) {
stroke(lines[i]);
let xPos = map(i, 0, NUM_LINES, 0, width);
line(xPos, 0, xPos, height);
}
}