Skip to content
Advertisement

Tag: minesweeper

Recursion Showing Adjacent Blank Mines in Minesweeper

I am fairly new to Java and I have been working on a Minesweeper game. I am trying to get the adjacent cells to be revealed recursively when an empty cell is clicked. I do this by calling showCell() shown below: Cells array declaration and population: toggleFlag() showCell() The problem I am having is when I hit this portion of

Which is the mistake in the code for game Minesweeper

Good morning. In short what the code does. When game begin, the user is asked System.out.print(“How many mines do you want on the field?: “);. User input a number and random are generate mines on the 2d array table. Parallel points (x, y) from 2d array where is mines are add to List<Point> points = new ArrayList<>(); points.add(new Point(x, y));

Advertisement