What would it take to use exactly the same code in all three of those loops? The first one starts i at bricks-0, the second at bricks-1, the third at bricks-2, so we'd need a new variable that has value 0 the first time, 1 the second, 2 the third.
Then we have x at i*width, i*width+.5, i*width+1. We need another variable that goes up from zero by halves. Adding float 0.5 repeatedly is likely to get accumulating error, so lets go up by 1 and divide by 2. And now that's the same as j isn't it?
Do you see where this is going? Fix up the y position and we can put this inside a loop that increments j ...
If it gets too deeply nested, make a new method.
Does that make sense? I haven' tried this, but I'm suspicious of the x position calculation. See how it looks and adjust if necessary.
Finally, just for myself, I'd rename "j" to "row" and "i" to "brickInRow" or something more meaningful. Simple i and j for ints is so common that many people will choke on that suggestion, so take it or leave it.
[ July 18, 2007: Message edited by: Stan James ]