I need to write a program Minesweeper.java that takes 3 command-line arguments M, N, and p and produces an M-by-N boolean array where each entry is occupied with probability p. Where I'm stuck is how to create a two dimensional array where the user inputs what the dimensions are. Any help with that part would be great, thanks :)
Asked
Active
Viewed 76 times
1 Answers
2
Here you go the main method:
public static void main(String args[]) {
int a = Integer.valueOf(args[0]);
int b = Integer.valueOf(args[1]);
int myArray[][] = new int[a][b];
//your code
}
It's java. Chapter 0

FMiscia
- 223
- 1
- 10