Exercise 03

We can stop our draw loop by using noLoop() in the setup

// here the draw loop only will run once
// refresh browser window to get new result

function setup() {
createCanvas(windowWidth, windowHeight);
noLoop();
}
function draw() {
// choose a random background color
background(random(255), random(255), random(255));
line(random(width),random(width),random(width),random(width));
}

Leave a Reply

Your email address will not be published.