COMPUTER CODING EXERCISES

 

 

 

Screen Shot 2015-09-21 at 8.48.47 pm

 

Screen Shot 2015-09-21 at 8.49.09 pm

 

CODE:

size(640, 360);
background(0);

int gridSize = 40;

for (int x = gridSize; x <= width – gridSize; x += gridSize) {
for (int y = gridSize; y <= height – gridSize; y += gridSize) {
noStroke();
fill(30, 40, 50);
rect(x-1, y-1, 3, 3);
stroke(250, 60);
line(x, y, width/20, height/20);
}
}

PROJECT REFLECTION:

image1The code created is repeating a process with the aim of approaching my desired goal. Beginning this project, I had the idea of creating lines that originate from specific point. With this target in mind, I sketched a design where multiple lines extended outwards from a designated point. Having this visualisation assisted me in developing the code as I could clearly identify the actions needed to produce the end result. With reference to the code presented in the workshops, I was able to create the lines, change the colours, move the position of starting point, and alter the opacity. However, in producing the for loops I made reference to a tutorial on Processing.org. The produced code is representative of the sketch I had drawn, although the grid is more obvious in the code, it still encapsulates my desired goal. The code created is simple, yet effective in its use of iteration as the results from one iteration are used as the starting point for the next iteration.

 

Processing.org For Loop Code:

[1] B.Fry, and C. Reas, n.d. Embeded Iteration, Processing.org. Available From: <https://processing.org/examples/embeddediteration.html&gt;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s