Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Create a new shape instead of the smiley, and put exactly 100 repeations repetitions on the screen
  • Modify the colour of your shape with each repetition

Example Solution to Exercise 7 


Code Block
int red;
int green;
int blue;
int myShapeSpacingX;
int myShapeSpacingY;
int offsetW = 30; // used to create an empty border around grid60;
void setup() {
  size(500660, 500660);
  myShapeSpacingX = (width-offset*2)/10; // offset is for left and right side
  myShapeSpacingY = (height-offset*2)/10; // offset is for top and bottom sidenoStroke();
  colorMode(HSB);
}

void draw() {
  background(255);
  for  (int i =01; i<=10; i++) {
    green+=10;
    for  (int j =01; j<=10; j++) {
      float hue red+=10= j*i*2.5;
      fill(color(red, greenhue,150, blue)255);
      myShape(offset+i*myShapeSpacingXW, offset+j*myShapeSpacingYW); 
    }
 
  red = 0;
  }
  green = 0;
}

void myShape(int x, int y) {
  int D = W/2;
  //ellipse(x, y, 30W, 30W);
  ellipsetriangle(x, y-15D, x-D, y+D, 15x+D, 15y+D);
}