Solves Googles Minesweeper game. Its not really an AI its an algorithm, AI is just in the name.
- python3.8+ (code contains asignment expressions (:=))
- pillow
- numpy
- pynput
- tesseract-ocr
- cd to MinesweeperAI-master/
python3.x -m venv venvvenv/bin/python -m pip install -r requirements.txtsudo apt install tesserect-ocr(windows instructions)- Make sure that tesseract is on PATH. Should be automatic on linux. For windows users refer to this guide on how to edit the PATH variable.
- Recomended to run via venv.
- Google
minesweeperand you should find googles minesweeper game. - Click play and select difficulty, make sure the game field is not covered by anything.
venv/bin/python main.py
- Pyscreenshot no longer required for linux users as pillow have linux support for ImageGrab in version <7.10.
- Now faster after removing duplicate clicking, updated pillow for faster screenshotting and reduced time sleeping.
- Much higher winrate after adding a second (slower) part to the algorithm if the first (faster) part gets stuck.