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.15for 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.