posted 13 years ago
You're just not running your loops right, so your center bricks are never drawn (which you only notice in the bottom row because all the other rows have outlines from surrounding bricks), your bottom row has thirteen bricks instead of twelve (counting the missing one), and there is no row with one brick.
First of all, use integer indexes, i.e., i, j, and k should be integers. Also, try to see similarities between the j-loop and k-loop. Could you collapse that logic into a single loop? Finally play around with your indexes on the j and k loops. Try to figure out why the bottom row has thirteen bricks, well, more accurately twelve bricks in thirteen positions, and the top row has two bricks instead of one. If you can solve that problem, your whole program will work.