Skip to content

AI that solves Minesweeper. Uses a probabilistic approach, scans the grid, trains a Reinforcement Learning model to take decisions based on the existing grid, and marks the grid with mines to complete the game.

Notifications You must be signed in to change notification settings

aryankeluskar/irina.minesweeper

Repository files navigation

irina - AI That Solves Minesweeper!

Built using Python. Inquisitive Riddler Investigating Navigational Arteries (in minesweeper), or irina for short (cause she is), is an Artifically Intelligent Model to solve Mineweeper by utilizing a probabilstic approach. Most Exciting Thing? This algorithm is nearing world record timings and this is just the beginning.

Stage Time
Beginner 5s
Intermediate 15s
Expert 32s
Beginner Intermediate Expert

You get: Finally solve the game, Flex to friends, Peace of Mind
I get (hopefully): Star, Heart, Follow :)

Install

(exclusive to Windows presently)

Requirements: gh, pip, python 3.12+
Run the following commands:
gh repo clone aryankeluskar/irina.minesweeper
pip install -r requirements.txt

Run the app

The app will auto-calibrate itself to your device's display assuming that you adhere to using the WINMINE.EXE given in the repo. Use the following command

python main.py

And let the magic (a.k.a. irina) shine brighter than all neon on broadway (pretty normal stuff imo)

How does it work?

It starts by randomly tapping 3 cells, then finds the probability of surrounding cells being a mine while training a Reinforcement Learning model in background to predict the next set of non-mine cells and click on them. This process repeats until there are no non-mine cells remaining. Motivation? My close friend and I were getting nostalgic over our high school memories of playing this beautifully haunting game but never winning, so I built this project to redeem our younger selves.

Support this project!

This has been quite an ambitious project (and a super memorable one ofc)! Please consider leaving a 🌟 if this added value to your wonderful life :)

Made with pure love and freshman fascination. Visit my website at aryankeluskar.github.io <3

About

AI that solves Minesweeper. Uses a probabilistic approach, scans the grid, trains a Reinforcement Learning model to take decisions based on the existing grid, and marks the grid with mines to complete the game.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published