size(500,500);
int W = width;
int H = height;
// variables
int n_circles = 5;
int x_amp = W / n_circles;
int y_amp = H / n_circles;
int c = 0;
int n = 1;
int t = 1;
// Grid
for(int g_y = y_amp/2 ; g_y <= H - y_amp/2 ; g_y = g_y + y_amp){
for(int g_x = x_amp/2 ;g_x <= W - ((x_amp/2) * t); g_x = g_x + x_amp){
if(c % 2 ==0){
fill(0,0,175);
} else{
fill(175,0,0);};
ellipse(g_x,g_y,x_amp,y_amp);
fill(0);
textSize(16);
textAlign(CENTER);
text(n, g_x, g_y);
n = n + 1;
}
c = c + 1;
t = t + 2;
}
save("Assignment4_part2.png");
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}