A little side project.
The code is REALLY bad.
Some codes are stolen from Games Computers Play, go check his videos out it's great.
NOTE! This solver only works on Windows system
- Download Minesweeper X、Arbiter, or any minesweeper game clone(Arbiter is recommended). Open the game.
- Change the scale to 125% in display settings (sorry for this one but I'll fix it if I have time).
- In terminal, run:
$ git clone https://github.com/jasonjustin/python-minesweeper-solver.git
$ pip install -r requirements.txt
$ cd python-minesweeper-solver
$ python solver.py [-m <mode>] [-t <times>] [-h | --help]
The solver will automatically find the game on screen and solve it.
It can play the game from the beginning, or finish the already started game.
Note: The top left corner cell must be covered when run in the middle of the game
The solver can solve multiple times if user specify the time using -t
. Statistics will be shown after all games are finished.
-h
--help
Show all the options.
-m
--mode
Game mode, B for Beginner, I for Intermediate, E for Expert. Default is Expert mdoe.
-t
--times
Multi-game mode, default is one time.
TODO:
- Refactor
- Rewrite with all CSP solving (may be faster)
- Introduce
Frontier Dynamic Programming