What I'm trying to get my head around is the idea behind offsetting x and y and the setting it back when drawing the rectangles, instead of just drawing the rectangles from (0,0) like this:
for (int y = 0; y < width; y = y+sqSize) {
for (int x = 0; x < height; x = x+sqSize) {
rect(x+2, y+2, sqSize-4, sqSize-4);
}
}
I'm guessing there is a perfectly good reason for doing it the other way, I'm just not smart enough to figure out why...