#include <cstdint>
#include <exception>
#include <tuple>
#include <vector>
#include <random>
#include <optional>
|
| class | TooManyMines |
| | The number of mines is more than what is possible given the size of the minefield. More...
|
| class | NoMinefield |
| | The board has no associated minefield. More...
|
| class | Minefield |
| | Field of cells, each being either a mine or a blank space. More...
|
| class | Board |
| | Game board, including the minefield, placed flags and uncovered cells. More...
|
|
| const std::vector< std::tuple< std::int32_t, std::int32_t > > | solve (const Minefield &minefield, const std::vector< std::tuple< std::int32_t, std::int32_t > > &moves) |
| | Solve a minefield.
|
◆ CellState
State of a cell on a game board.
| Enumerator |
|---|
| Hidden | Cell is not uncovered and not marked.
|
| Flag | Cell is not uncovered and flagged.
|
| Mark | Cell is not uncovered and marked.
|
| Uncovered | Cell is uncovered.
|
◆ CellType
Type of a cell in a minefield.
| Enumerator |
|---|
| Empty | Empty cell.
|
| Mine | Mine cell.
|
◆ solve()
| const std::vector< std::tuple< std::int32_t, std::int32_t > > solve |
( |
const Minefield & | minefield, |
|
|
const std::vector< std::tuple< std::int32_t, std::int32_t > > & | moves ) |
|
export |
Solve a minefield.
- Parameters
-
| minefield | Minefield to solve. |
| moves | List of (x, y) coordinates of previously uncovered fields. |
- Returns
- List of (x, y) coordinates of empty fields. If empty, the minefield is unsolvable.