Solves Minesweeper using an automated browser and custom constraint based solver.
demo.mp4
Note
The demo video is slightly outdated. Append --cli to the command so that the GUI does not pop up.
- Currently has one frontend and two backends:
- (Frontend) Google builtin minesweeper game automated with selenium (can also be run
--headless) - (Backend) (default,
--solver py) Adhoc constraint based solver written in python - (Backend) (
--solver hs) Generalised constraint based solver written in haskell (with psuedo proofs for its moves)
- (Frontend) Google builtin minesweeper game automated with selenium (can also be run
- Saves log files for each game with detailed information for each action (to
./logs/) - Written in modular manner to allow adding additional frontends and backends with ease
- GUI+CLI using Gooey (pass
--clito use on command line)
- Python
- Chrome (Uses chrome specific features)
- GHC (for haskell backend)
python src/main.py
- Clone repository
git clone https://github.com/advay168/minesweeper-solver
cd minesweeper-solver
- Optionally: Create virtual enviroment
python -m venv .venv
./.venv/Scripts/activate
# On Windows: .\.venv\Scripts\activate
- Install python requirements
pip install -r requirements.txt
- Run with default settings and GUI
python src/main.py
- View help for available options
python src/main.py -h
- Run program indefinitely (only a Windows script available for now)
run_infinite.bat {args to forward to main.py}
- Selneium is quite slow and is the bottleneck. Other frontends can be added such as using pupeeter or a custom ui.
- If the game is unsolveable then it aborts instead of guessing the most likely move using heuristics.