how to Write a function “minesweeper(int, int, int )” that takes 3 arguments a, b, and p and produces an a-by-b Boolean array where each entry is occupied with probability p (e.g. if the randomly generated number is less than or equal to p, the cell is referred as empty else occupied) . In the minesweeper game, occupied cells represent bombs and empty cells represent safe cells. Print out the array using an asterisk for bombs and a period for safe cells. Then, replace each safe square with the number of neighboring bombs (above, below, left, right, or diagonal).

Post what you've written. We will try and help, but we're not going to write it for you.
i just want to get a idea about it,but i have no idea to start it,
look at array, rand, srand

if you want to set the arrays size like this, you will need to use pointers
Topic archived. No new replies allowed.