I have to create a minesweeper game for my java class.
but im having trouble creating the method to generate a random mine field?!?!
(i dont even know where to start)
public static boolean [][] generateMineField ( int length, int width, int numberMines)
This method generates a new mine field as a matrix of boolean values where a cell is set to "true" to indicate the presence of a mine. The length and the width of the field are provided, and also the desired number of mines (numberMines).
Hint: Use Math.random(), Math.floor(), and type cast to generate random positions for the mines.
ThanK You!