# Computer Coding Exercises

The work is the repetition of a same random size rectangle with a random color and a shadow with in the frame. The square will change size and color in the different frame. The shadow display in different size of the square make the works stands out and also give the work 3-dimension look. The hardest part of the work is to place the shadow in the right spot to match up with the color rectangle. The work was inspirations from the Skittle fruits, which have a random color in the bag, the processing website and the tutorial workshop week 5 – 8. In week 5(http://medadada.net/), I get to use the Processing to create a loop of the ellipse. After that I decided to change the ellipse to the rectangle. The processing.org is useful as it is give an example of key code, which I use it in the artwork. The website also give a clearer understanding of how to use the processing. With the use of the website such as; medadada.net, processing.org and tutorial I learned how to use the processing to sketch, color and with the improvement I know how to make the code easier to read which result are show in the final work.

code:

void setup() {
size(800, 800);
noStroke();
frameRate(1);
}

void draw() {
background(185);
int number = (int) random(10, 40);
int between = (int) random(2, 10);
float rectsize = ( width – (number++) * between ) / (float)number;
float X = rectsize/20.0;
float Y = rectsize/20.0;
for (int a=0; a<number; a++) {
for (int b=0; b<number; b++) {
fill(random(160), 180);
rect(between * (a+1) + rectsize * a + X, between * (b+1) + rectsize * b + Y, rectsize, rectsize);
fill(random(255), random(255), random(255),random(255) );
if (mousePressed) {
fill(random(247), random(100), random(100), 180);
}
rect(between * (a+1) + rectsize * a, between * (b+1) + rectsize * b, rectsize, rectsize);
}
}
}

Click on the image for a larger view