Skip to content

PiispaH/Minesweeper-Solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper-Solver

Contains solvers and a framework for easily building new ones. The SolverBase -class takes care of starting a new game and handling the interactions with it. At its simplest, a new solver can just inherit from the base class and implement only the logic method, that contains the solver logic.

Solvers

Random:

This solver randomly clicks on cells.

Naive:

This solver makes decisions based on 3x3 subgrids. If it determines that all the unopened cells in a 3x3 subgrid are mines it flags them, if it thinks that all of them are safe, it opens them. If it can't deduct anymore safe or flaggable cells, it opens a cell that has the lowest probability of uncovering a mine.

DQL:

This solver is is powered by a reinforcement learning model. DQL is used to train a model to select the safest cell to open.

Usage

Clone the repository and run

pip install -e .

with a fresh virtual environment to install the dependencies. If you want to run or train the reinforcement learning models, follow these instructions to install pytorch.

Run the command

msolver --help

for information on the available commands, and

msolver command --help

for information on individual commands.

About

A framework for minesweeper solvers. Also contains some solvers.

Resources

License

Stars

Watchers

Forks

Contributors

Languages