code is a language. some schools even allow you to substitute a class in C for French or German. consider these parallels:
reading code is an excellent way to get familiar with the parts, and that eventually one could make the leap from translation to thinking directly in code. though we usually think of code as manipulating abstract symbols, code also generates narrative and metaphorical space.
consider this example, try covering each side. could you translate from processing to english and from english to processing?
void draw() { background(224); // the plot area is a white box fill(255); rectMode(CORNERS); noStroke(); rect(plotX1,plotY1, plotX2, plotY2); drawTitle(); drawAxisLabels(); stroke(#5679C1); strokeWeight(5); }
function "draw" accepts no arguments and returns void.
start function draw.
set the background to gray 224.
comment: let's draw a white box behind the plot area.
set the fill to white.
set the rectangle mode to CORNERS.
run/activate the noStroke function.
draw a rectangle with corners:
plotX1, plotY1, plotX2, and plotY2.
run your drawTitle function without arguments.
run your drawAxisLabels function without arguments.
set the stroke to hex value 5679C1.
set the stroke weight to 5.
end function draw.
I am going to read a chunk of processing code. I would like you to transcribe it in the processing IDE, compile it, put it in your pages folder and post your name and link below.
write a sketch that prints its own code on the canvas (something like a quine) 1)