Using an array and randomizing the elements of the design (circles, squares, dots, lines). The hard part was using a bunch of if-statements so that there won’t be overlap of the elements (see the update and display functions below to get the idea).
void update() {
line1 = random(1) < bias;
line2 = random(1) < bias;
line3 = random(1) < bias;
line4 = random(1) < bias;
line5 = random(1) < bias;
line6 = random(1) < bias;
line7 = random(1) < bias;
line8 = random(1) < bias;
dot1 = random(1) < bias;
dot2 = random(1) < bias;
dot3 = random(1) < bias;
dot4 = random(1) < bias;
dot5 = random(1) < bias;
dot6 = random(1) < bias;
dot7 = random(1) < bias;
dot8 = random(1) < bias;
dot9 = random(1) < bias;
circle1 = random(1) < bias;
circle2 = random(1) < bias;
circle3 = random(1) < bias;
circle4 = random(1) < bias;
circle5 = random(1) < bias;
circle6 = random(1) < bias;
circle7 = random(1) < bias;
circle8 = random(1) < bias;
circle9 = random(1) < bias;
square1 = random(1) < bias;
square2 = random(1) < bias;
square3 = random(1) < bias;
square4 = random(1) < bias;
square5 = random(1) < bias;
square6 = random(1) < bias;
square7 = random(1) < bias;
square8 = random(1) < bias;
square9 = random(1) < bias;
rectblank1 = random(1) < bias;
rectblank2 = random(1) < bias;
rectblank3 = random(1) < bias;
rectblank4 = random(1) < bias;
triblank1 = random(1) < bias;
triblank2 = random(1) < bias;
triblank3 = random(1) < bias;
triblank4 = random(1) < bias;
triblank5 = random(1) < bias;
triblank6 = random(1) < bias;
triblank7 = random(1) < bias;
triblank8 = random(1) < bias;
}
void display(){
if (squared){
// Draw squares:
noFill();
stroke(hu, sa, br);
strokeWeight(us/28.57); // sets internal shape line width
rectMode(CENTER);
if (square1 && !circle1) {rect(x-us/4, y-us/4, us/6.67, us/6.67);}
if (square2 && !circle2) {rect(x, y-us/4, us/6.67, us/6.67);}
if (square3 && !circle3) {rect(x+us/4, y-us/4, us/6.67, us/6.67);}
if (square4 && !circle4) {rect(x-us/4, y, us/6.67, us/6.67);}
if (square5 && !circle5) {rect(x, y, us/6.67, us/6.67);}
if (square6 && !circle6) {rect(x+us/4, y, us/6.67, us/6.67);}
if (square7 && !circle7) {rect(x-us/4, y+us/4, us/6.67, us/6.67);}
if (square8 && !circle8) {rect(x, y+us/4, us/6.67, us/6.67);}
if (square9 && !circle9) {rect(x+us/4, y+us/4, us/6.67, us/6.67);}
}
if (round) {
// Draw circles:
noFill();
stroke(hu, sa, br);
strokeWeight(us/28.57); // sets internal shape line width
ellipseMode(CENTER);
if (circle1 && !square1) {ellipse(x-us/4, y-us/4, us/5.33, us/5.33);}
if (circle2 && !square2) {ellipse(x, y-us/4, us/5.33, us/5.33);}
if (circle3 && !square3) {ellipse(x+us/4, y-us/4, us/5.33, us/5.33);}
if (circle4 && !square4) {ellipse(x-us/4, y, us/5.33, us/5.33);}
if (circle5 && !square5) {ellipse(x, y, us/5.33, us/5.33);}
if (circle6 && !square6) {ellipse(x+us/4, y, us/5.33, us/5.33);}
if (circle7 && !square7) {ellipse(x-us/4, y+us/4, us/5.33, us/5.33);}
if (circle8 && !square8) {ellipse(x, y+us/4, us/5.33, us/5.33);}
if (circle9 && !square9) {ellipse(x+us/4, y+us/4, us/5.33, us/5.33);}
}
if (blanked){
// draw blanks:
fill(bg);
stroke(bg);
strokeWeight(1);
rectMode(CORNERS);
if ((rectblank1 && !dot2) && (!dot5 && !dot8)) {rect(x-us/2.2, y-us/2.2, x+us/2.2, y);}
if ((rectblank2 && !dot4) && (!dot5 && !dot6)) {rect(x-us/2.2, y-us/2.2, x, y+us/2.2);}
if ((rectblank3 && !dot2) && (!dot5 && !dot8)) {rect(x+us/2.2, y+us/2.2, x, y-us/2.2);}
if ((rectblank4 && !dot4) && (!dot5 && !dot6)) {rect(x+us/2.2, y+us/2.2, x-us/2.2, y);}
fill(bg);
stroke(bg);
strokeWeight(1);
if ((triblank1 && !dot1) && (!dot5 && !dot2)) {triangle(x, y, x-us/2.2, y-us/2.2, x, y-us/2.2);}
if ((triblank2 && !dot1) && (!dot5 && !dot4)) {triangle(x, y, x-us/2.2, y-us/2.2, x-us/2.2, y);}
if ((triblank3 && !dot3) && (!dot5 && !dot2)) {triangle(x, y, x+us/2.2, y-us/2.2, x, y-us/2.2);}
if ((triblank4 && !dot3) && (!dot5 && !dot6)) {triangle(x, y, x+us/2.2, y-us/2.2, x+us/2.2, y);}
if ((triblank5 && !dot7) && (!dot5 && !dot4)) {triangle(x, y, x-us/2.2, y+us/2.2, x-us/2.2, y);}
if ((triblank6 && !dot7) && (!dot5 && !dot8)) {triangle(x, y, x-us/2.2, y+us/2.2, x, y+us/2.2);}
if ((triblank7 && !dot9) && (!dot5 && !dot6)) {triangle(x, y, x+us/2.2, y+us/2.2, x+us/2.2, y);}
if ((triblank8 && !dot9) && (!dot5 && !dot8)) {triangle(x, y, x+us/2.2, y+us/2.2, x, y+us/2.2);}
}
if (round){
// Draw dots:
ellipseMode(CENTER);
fill(hu, sa, br);
noStroke();
if (dot1 && !line1) {ellipse(x-us/4, y-us/4, us/16.67, us/16.67);}
if ((dot2 && !line4) && (!rectblank1 && !rectblank3)) {ellipse(x, y-us/4, us/16.67, us/16.67);}
if (dot3 && !line6) {ellipse(x+us/4, y-us/4, us/16.67, us/16.67);}
if ((dot4 && !line2) && (!rectblank2 && !rectblank4)) {ellipse(x-us/4, y, us/16.67, us/16.67);}
if (dot5) {ellipse(x, y, us/16.67, us/16.67);}
if ((dot6 && !line7) && (!rectblank2 && !rectblank4)) {ellipse(x+us/4, y, us/16.67, us/16.67);}
if (dot7 && !line3) {ellipse(x-us/4, y+us/4, us/16.67, us/16.67);}
if (dot8 && !line5) {ellipse(x, y+us/4, us/16.67, us/16.67);}
if ((dot9 && !line8) && (!rectblank1 && !rectblank3)) {ellipse(x+us/4, y+us/4, us/16.67, us/16.67);}
}
if (lined){// Draw lines:
noFill();
stroke(hu, sa, br);
strokeWeight(us/40);
strokeCap(ROUND);
if (line1 && !dot1) {line(x, y, x-us/2.25, y-us/2.25);}
if (line2 && !dot4) {line(x, y, x-us/2.25, y);}
if (line3 && !dot7) {line(x, y, x-us/2.25, y+us/2.25);}
if (line4 && !dot2) {line(x, y, x, y-us/2.25);}
if (line5 && !dot8) {line(x, y, x, y+us/2.25);}
if (line6 && !dot3) {line(x, y, x+us/2.25, y-us/2.25);}
if (line7 && !dot6) {line(x, y, x+us/2.25, y);}
if (line8 && !dot9) {line(x, y, x+us/2.25, y+us/2.25);}
}
// Draw border:
if (border) {
noFill();
stroke(hu, sa, br);
strokeWeight(us/40); // sets line width
rectMode(CENTER);
rect (x, y, us/1.1, us/1.1); // border line
}
}