# Computer Coding Exercises

The aim of my creative piece was to mimic the look of barcodes. Barcodes are a source of identification and their artistic value can be overlooked as a source of a label.

The use of random shades of grey mimic the look of a barcode through the varying width of the vertical lines present on a barcode. This idea was inspired by my job – I am surrounded by barcodes throughout my workplace and they become a source of identity for each item.  I thought it would be cool to represent barcodes in an artistic notion and create a vortex effect by rotating the lines within the work. The work not only features a gradation of lines, but colours. This further creates the vortex look of the work and was achieved through iteration within the coding.

The work is inspired by Andy Warhol’s principle within his own works – repetition. The pop style work I have created features exposure of simple shapes, suggesting that the barcodes we rely on to identify and sell products can too the ones consumed (but in an artistic value). The work also challenges pop art’s values- instead of using the work as an advertisement for an item, the barcode is taken to a new appreciation and is the artwork instead.

Here is a copy of the code below:

size (600,600);
//dimensions of the artwork

background(22,22,22);
noStroke();
//this feature means that there will be no bold lines around the shapes
smooth();
//this feature smoothed and straightened the lines of the rectangles, rather
//than having the lines jagged.

float c= 0;

while(c < 120) {
// this equals 120 rectangles each line.
// I opted to using ‘while’ as iteration rather than ‘for’ as it suited the
//style of image that I was creating. Using ‘while’ was also easier to adapt and
//understand as tutorials I found online used it instead of ‘for’. The tutorial
// that I based my work off is: http://funprogramming.org/26-Make-patterns-
//by-rotating-objects.html

fill(random(255));
//The use of random shades of grey mimic the look of a barcode – the aim of my work
//is to mimic barcodes. This idea was inspired by my job – I am surrounded by
//barcodes throughout my workplace and they become a source of identity for each item.
// I thought it would be cool to represent barcodes in an artistic notion and have
//them represented as more than a source of item identity, but rather taking the
//barcode as a source of creativity and artistic value.
rect (10,2,13, 1);

fill(random(255));
//random within the 255 range will present shades of grey
rect (30,2,13, 1);

fill(random(255));
rect (50,4,15, 2);

fill(random(255));
rect (72,4,15, 2);
//by copy and pasting, and increasing the height and width(slightly), I was able to
//create longer rectangles (and slightly wider) and longer gaps between the rows,
//to overall create the vortex effect in the work.

fill(random(255));
rect (97,6,15, 3);

fill(random(255));
rect (125,8,20, 4);

fill(random(255));
rect (160,8,40, 7);
//slowly increasing the tallness (throughout each step) expanded
//the length of the rectangles

fill(random(255));
rect (220,10,50, 7);
//the following two lines above are the orginal steps from the website:
//http://funprogramming.org/26-Make-patterns-by-rotating-objects.html. I then
//repeated this steps, varying the width and height to create the pattern.

fill (random(200));
rect (300,10,100,10);

fill (random(200));
rect (440,12,140,12);

fill (random(200));
rect (624,12,140,12);

fill (random(200));
rect (800,12,140,12);

rotate(0.05);
// the number is the angle of rotation

c = c + 1;
//plus one increases the variable
}