bool move(int tile)
{
int xaxis = d - 1;
int yaxis = d - 1;
int tile_i;
int tile_j;
search_the_board(tile);
if (tile_i == xaxis + 1 || tile_i == xaxis - 1)
if (tile_j == yaxis + 1 || tile_j == yaxis - 1)
{
swap(&xaxis, &tile_i);
swap(&yaxis, &tile_j);
}
return false;
}
int search_the_board(int tile)
{
for (int i = 0; i < d-1; i++)
{
for (int j = 0; j < d-1; j++)
{
if (board[i][j] == tile)
{
tile_i = i;
tile_j = j;
}
}
}
};
Error message 1: Initialize the variable "tile_i" to silence this warning
I thought that since I'm calling the function search_the_board in the move function, the values are returned? Please help!