im trying to do minesweeper in java. I’m using matrix. I want to know which row and columns has mine which is “* “.
Which method can i use.
i create mine matrix like that and i want to determine every mine position like 4,3 5,2 7,1. How can i do it. I tried .equals but it didnt gone quiet well.
for (int i = 0; i < 10; i++) {
int xAxis = randomMines.nextInt(1, 10);
int yAxis = randomMines.nextInt(1, 10);
if (hiddenMatris[xAxis][yAxis] == "* ") {
i--;
}
hiddenMatris[xAxis][yAxis] = "* ";
New contributor
Vielash is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1