xxxxxxxxxx
40
// conditionals
// probability
let x = 0;
let y = 0;
let space = 10;
function setup() {
createCanvas(400, 400);
background(200);
}
function draw() {
let randy = random();
if(randy > 0.5){
line(x, y + space, x + space, y);
} else {
line(x,y,x + space,y + space);
}
if(x > 400){
x = 0;
y = y + space;
} else {
x = x + space;
}
}
// Assignment
// Make it yours
// algorithm for / => line(x,y + space,x + space,y)
// line(x, y + space, x + space, y);
// // algorithm for \ => line(x,y,x + space,y + space)
// line(x,y,x + space,y + space);