xxxxxxxxxx
52
let x = 300;
let y = 550;
let y1 = 550;
let y2 = 550;
function setup() {
createCanvas(900, 600);
background(20);
}
function draw() {
strokeWeight(2);
r = floor(randomGaussian(300,10));
rscaled = r*2
// most common results -- 34% of the time each
if (r < 300 && r > 290) {
stroke(104,7,249);
y=y-1;
ellipse(rscaled,y,1);
}
else if (r< 310 && r> 300) {
stroke(104,7,249);
y = y-1;
ellipse(rscaled,y,1);
}
// next most likely -- 13.5% of the time each
else if (r <290 && r> 280) {
stroke(152,82,249);
y1 = y1-1;
ellipse(rscaled,y1,1);
}
else if (r<320 && r> 310) {
stroke(152,82,249);
y1 = y1-1;
ellipse(rscaled,y1,1);
}
else if (r< 280 ) {
stroke(194,153,252);
y2 = y2-1;
ellipse(rscaled,y2,1);
}
else if (r > 320) {
stroke(194,153,252);
y2 = y2-1;
ellipse(rscaled,y2,1);
}
console.log(r,y,y1,y2);
}