I suggest adding some spaces, it helps in reading code.
Also using some constants helps in understanding relationship of various uses:
Code:size(500, 500);
smooth();
background(255);
fill(200, 0, 0);
int EL_SIZE = 20;
for (int i = 0; i < width; i += EL_SIZE)
{
ellipse(width - i, i, EL_SIZE, EL_SIZE);
}
You can also make variations on some parameters, like fill color:
Code:size(500, 500);
smooth();
background(255);
int EL_SIZE = 20;
color START_COLOR = color(0); // Black
color END_COLOR = color(255, 0, 0); // Red
for (int i = 0; i < width; i += EL_SIZE)
{
fill(lerpColor(START_COLOR, END_COLOR, (float) i / width));
ellipse(width - i, i, EL_SIZE, EL_SIZE);
}
or ellipse size:
Code:fill(END_COLOR);
for (int i = 0; i < width; i += EL_SIZE)
{
float elSize = EL_SIZE * 1.414 * i / width;
ellipse(width - i, i, elSize, elSize);
}
or on each parameter:
Code:for (int i = 0; i < width; i += EL_SIZE)
{
float elSize1 = EL_SIZE * 3.0 * i / width;
float elSize2 = EL_SIZE * (1.00 - 2.0 * i / width);
ellipse(width - i, i, elSize1, elSize2);
}
It shows it is interesting to play with variations on code.