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):.

And this is what I get everytime I run:

1 Answer 1


I figured out the issue! It works in theory, I just needed to put the add(window, brick) in the individual branches. Though, I've changed my code so I have no identical lines.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .