Skip to main content

Difficulty Type

Mode support various difficulty types.

TOTAL_MINES​

Description​

Specify the total number of mines that will be randomly placed on the Minesweeper board for each game session.

Details​

  • This value determines the exact number of mines hidden on the board, regardless of the board’s size.
  • Increasing this number makes the game more challenging, while decreasing it makes the game easier.

Example​

mode:
easy:
type: TOTAL_MINES
value: 10

This will place exactly 10 mines on the board.

mode:
hard:
type: TOTAL_MINES
value: 50

This will place exactly 50 mines on the board.


MINES_DENSITY​

Description​

Defines the percentage of the board that will be filled with mines.

Details​

  • Expressed as a decimal between 0 and 1 (e.g., 0.15 for 15%).
  • The total number of mines is calculated as:
    total mines = total number of cells Γ— MINES_DENSITY

Example​

mode:
hard:
type: MINES_DENSITY
value: 0.12

If your board has 100 cells and MINES_DENSITY is set to 0.12, then:
totalMines = (int) (100 * 0.12) = 12

This will fill 12% of the board’s cells with mines.