You have two serious problems here. First, your move() function defines int blank = board[d][d]; The array element board[d][d] doesn't exist because both indexes run from 0 to d-1. Anything with d as an index is out of range. Even if it had d-1 as the two indexes, it's still broken because the blank cell is only known to be in the lower right when the game ...
In my code when the problem was that
in 3 x 3 board when I was starting game with 3 then tile goes up and after that if you exchange with 2, it was exchanging which is not a permissible move
one can understand from following
5|4|3 initial condition
after one move
2nd move(which is not permissible)
When you click to show the variable "play/pause", it shows that the variable is indeed working - it switches from play to pause and back again every time you click "p". However, nothing happens when you hit "p". That's because you haven't implemented anything - the ball simply keeps going and the game moves on. What if you replace the if statement in the ...