I'd create a point array as long as there are mines and the location for each one in their element. Like this, kind of.
Code:
//mine_num = number of mines
POINT mines[mine_num]
srand(time(NULL));
for(i=0; i<mine_num; i++)
{
mines[i].x = rand() % /*size of horizontal side*/;
mines[i].y = rand() % /*size of vertical side*/;
for(j=0; j<mine_num; j++)
{
if(mines[i].x == mines[j].x) i--;
else if(mines[i].y == mines[j].y) i--;
}
}
//...
EDIT: Oops, I messed up that part to see if it was in the same place. Here's what the code should look like.
Code:
//mine_num = number of mines
POINT mines[mine_num]
srand(time(NULL));
for(i=0; i<mine_num; i++)
{
mines[i].x = rand() % /*size of horizontal side*/;
mines[i].y = rand() % /*size of vertical side*/;
for(j=0; j<mine_num; j++)
{
if((mines[i].x == mines[j].x) && (mines[i].y == mines[j].y) && (j != i)) i--;
}
}
//...