I don't understand why my implementation of initBricks isn't working. I noticed that most people have been using nested loops for the ROWS and COLS and I don't particularly mind using doing that too, but I don't understand why my implementation doesn't work at least in theory. Is there something I am not getting?
Here's my code (I didn't include all of it, but my logic is the same throughout):