Can anyone explain to me what is asked from us in move function regarding pset3? I've finished init and draw, it compiles and prints on terminal exactly as it should. But I don't know what is my task on move function, I understand that we should swap underscore(0) and tile number that we are given, but what next? Any help would be much appreciated..
To solve that function first I locate the tile in the 2D array now depending on what part of the board the tile is it will "look" for the empty space(0) next to it. Note that if a tile is lets say on the top left of the board(i=0, j=0)it can only be compared to the index to right of if or below it because there's no i=-1 or j=-1 also theres no i>=d or j>=d. So i anticipated tht different circumstances a tile could be in and compared to its possible adjacente tiles, if the zero is in fact next to it a simple swap of values, and return true. Hope this helps!