int cols = 18;
int rows = 12;
int spacing = 30;
color[] colors = {color(255, 31, 58), color(255, 104, 254), color(254, 244, 6), color(137, 196, 255)};
ArrayList<Dot> dots;
void setup() {
size(640, 480);
smooth();
dots = new ArrayList();
for (int i = 0; i < cols; i++) {
for (int j = 0; j < rows; j++) {
float centerX = (width - ((cols - 1) * spacing)) / 2;
float centerY = (height - ((rows - 1) * spacing)) / 2;
float x = centerX + (i * spacing);
float y = centerY + (j * spacing);
PVector position = new PVector(x, y);
Dot dot = new Dot(position, 10, colors[int(random(4))]);
dots.add(dot);
}
}
}
void draw() {
background(240, 255, 248);
for (int i = 0; i < dots.size(); i++) {
Dot dot = dots.get(i);
dot.render();
}
}
class Dot {
PVector position;
int radius;
color col;
Dot(PVector _position, int _radius, color _col) {
position = _position;
radius = _radius;
col = _col;
}
void render() {
noStroke();
fill(col);
ellipse(position.x, position.y, radius, radius);
}
}
I'm struggling to translate that code to Quil or better say functional programming