Hello,
You set your first “ajustar” (which is “set”) before your first bool, so it goes +1 on each tick.
You don’t need 4 “contador” but 2 only, “arriba” and “izquierd” you do +1, “abajo” and “deracha” you do -1 to the right variable and add a limit to < 0, not 100.
As you grid starts at 0 checking >100 makes a 101 x 101 grid so you would do >99 or >= 100.