(I tried swapping 1 with the blank tile, and it duplicated the blank tile and that happens every time I swap with a number on the left or right - it works fine swapping up or down).
I tried to fix this problem, but, from what I've been seeing in the questions here, my code seems to be correct. The problem may be located in another function of my code, so I'll post all of them here.
Consider that I haven't changed a thing in the code itself (just implemented the functions). Also, I haven't yet implemented won, so I won't post it here.
Deleted code for academic honesty
Does anyone know what is happening?
PS.:For academic reasons, I will delete my code from here after the question has been answered.