I'm trying to code the game Minesweeper and for that I need to randomize the bombs locations.
Can someone help change the function a bit so that placing of bombs is randomized?
THE CODE:
void Createbomb(int*** bord, int size)//size+1
{
//bomb num.1
(*bord)[size - 5][size - 1] = 9;
//bomb num.2
(*bord)[size - 4][size - 4] = 9;
//bomb num.3
(*bord)[size - 3][size - 2] = 9;
//bomb num.4
(*bord)[size - 2][size - 2] = 9;
//bomb num.5
(*bord)[size - 1][size - 5] = 9;
}