[Solved] I don’t know what’s wrong


Let’s see. Assume first time it runs, x,y is 1,1. So you add Box(1,1).

Next time is run, let’s assume x,y is 2,3. So, enter for loop:

  • i = 0: Not same x,y, so enter else, and add Box(2,3).
  • i = 1: Same as x,y (yeah, we just added it), so enter if and remove Box(2,3).

Result: Box added and removed again.

Oh yeah, a debugger would have told you the same thing.

solved I don’t know what’s wrong