You have several major problems here. First, look carefully at this if/else:
if (board[i][j] == tile) //search for tile
{
...
}
else
return false;
It says that if you don't find the tile in board[i][j], return false. That means that unless the tile you're searching for is the very first tile, it's going to quit and return false to the calling code. It'll never get past the first tile.
Next, the conde inside that if statement will, if executed, do a great job of swapping the values stored in swapper, blank_tile, and tile. Unfortunately, it won't do a thing to swap the actual values stored in board[][]. In short, nothing on the actual board gets swapped. You have to swap the actual elements in the board[][] array.
Next, look at the test for the blank tile.
if (board[i][j + 1] == blank_tile || board[i - 1][j] == blank_tile
|| board[i + 1][j] == blank_tile) //swap tile with blank_tile
This is supposed to identify that there's a blank tile adjacent to the tile to be swapped. Unfortunately, it doesn't identify which tile. It merely narrows it down to 4 tiles. How do you know which one to swap? Worse still, it tests outside the bounds of the array (it goes off the edge of the board). Consider what happens when d=3. Now, say that i=2 and j=2. That means that i+1=3 and j+1=3. That's two cases where the array index will be beyond the dimensions of the array. Usually, this results in invalid data being swapped into the board array (usually, extra 0's) and valid data being deleted and replaced by these 0's.
Think about these lines:
int blank_tile = 0;
...
if (board[i][j] == 0)
board[i][j] = blank_tile;
This is called dead code. It executes, but effectively does nothing. In short, it says that if board[i][j] is 0, change it to 0. These last two lines could be completely removed and result in no change at all, except to improve performance.
There's a lot of work to be done. Once rewritten, if you have any new questions, please post a new question with the updated code.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)