Skip to content

EliasEriksson/MinesweeperAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MinesweeperAI

Solves Googles Minesweeper game. Its not really an AI its an algorithm, AI is just in the name.

Showcase

https://youtu.be/5_6p96whgy0

Dependencies

  • python3.8+ (code contains asignment expressions (:=))
  • pillow
  • numpy
  • pynput
  • tesseract-ocr

Setup

  1. cd to MinesweeperAI-master/
  2. python3.x -m venv venv
  3. venv/bin/python -m pip install -r requirements.txt
  4. sudo apt install tesserect-ocr (windows instructions)
  5. 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.

Usage

  • Recomended to run via venv.
  • Google minesweeper and 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

Major changes

  • 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.

About

Solves Googles Minesweeper game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages