Skip to content

Language Settings

Random

Random numbers create the basis of this image. Each time the program is loaded the result is different.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function setup() {
  createCanvas(710, 400);
  background(0);
  strokeWeight(20);
  frameRate(2);
}
function draw() {
  for (let i = 0; i < width; i++) {
    let r = random(255);
    stroke(r);
    line(i, 0, i, height);
  }
}
X

creative commons license