> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.BMwa1XZnKLT/rev.60
 * 
 * authors: 
 *   Pablo Olmos de Aguilera Corradini

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// This sketch builds on a prior work created by J.D. Zamfirescu
// http://studio.sketchpad.cc/sp/pad/view/ro.9lF0R3w4QH6ji/rev.4

//Using the square function from the exercise above, draw five concentric squares and five concentric circles centered on the point (100, 100).

void square(float posX, float posY, float sideLength) {
  float x = posX - sideLength /2;
  float y = posY - sideLength /2;
  
  rect(x, y, sideLength, sideLength);
}

void circle(float posX, posY, float length) {
 
    ellipse(posX, posY, length, length);
}

void setup() {
  size(200, 200);
  
  int length = 20;
  
  noFill();
  
  for (i = 1; i < 6; i++) {
      square(100, 100, length);
      circle(100, 100, length);
      length = length + 20;
  }
}