Remake of the classic Minesweeper game, written in Python.
Read more about the project history in my blog post.
The application has been packaged with PyInstaller so that it can be played without setting up Python.
Download links available here:
- Windows (amd64)
- Linux (x86_64)
- MacOS (x86_64)
- MacOS (arm64) (not yet available, see issue #214)
The Python package is also available on PyPI: https://pypi.org/project/minegauler/.
- Python 3.8+ required (check with
python3 --version
) - Install with
python3 -m pip install minegauler
- Run with
python3 -m minegauler
See note on system dependencies below, or get in touch if you have any issues.
You will need Python 3.8+ to run the code (check with python3 --version
).
- Clone the repo:
git clone https://github.com/LewisGaul/minegauler
- Change directory:
cd minegauler
- Consider setting up a virtual environment
- Install requirements with
python3 -m pip install -r requirements.txt
- Run with
python3 -m minegauler
If running in WSL (Windows Subsystem for Linux) you will need to set up an X-server for running graphical apps. This isn't too difficult to do, see https://wiki.ubuntu.com/WSL#Running_Graphical_Applications or search online for further advice - I would recommend downloading and using Xming.
If running with python -m minegauler
fails with Aborted (core dumped)
on Linux, you may need a package that provides graphical support. For me this was fixed by running sudo apt install libxkbcommon-x11-0
on Ubuntu in WSL1.
This app provides all of the basic functionality of the classic minesweeper game plus much more!
Game menu:
- Create boards - create a board by placing mines, which can then be saved and loaded.
- Save and load boards - challenge friends to a board you played or created.
- Get current game info - see some info about the current game, e.g. if you lose a game you get a completion percentage and a predicted time.
- Local highscores - stores highscores and allows filtering/sorting in the UI.
- 5 difficulty levels - the standard beginner, intermediate and expert, plus two bonus levels of increasing difficulty!
- Custom - set a custom board size and number of mines.
- Button size - set the size of the cells.
- Themes - app themes include 'butterfly', 'halloween', 'christmas'.
Options menu:
- Safe start - ensure the first click always gives an opening, or at least gives a safe cell if there are too many mines to give an opening.
- Drag select - enable selecting cells by clicking once and dragging the mouse.
- Max mines per cell - allow up to 3 mines per cell.
- Reach - the number of neighbouring cells cell numbers detect.
- Game mode
- Regular - the standard minesweeper game.
- Split cell - Each large cell can be split into the 4 underlying regular cells using 'right-click'. Large cells can only be split if they contain at least one mine, and must be split to find all of the safe regular cells.
Note that all of the options above except 'safe start' have separate highscore tables.
Help menu:
- Rules, features, tips.
- Retrieve highscores - import highscores from an old version of the app (only works for versions at least v4.0).
Check the changelog to see a log of changes that have been made. See issues for upcoming features/fixes.
If there's a feature you'd like to see added, please don't hesitate to contact me!
Install the developer requirements with python3 -m pip install -r requirements-dev.txt
.
Run the tests with the command pytest
(see the pytest docs).
Get coverage information using the pytest-cov plugin: pytest --cov minegauler [--cov-report html]
.
Please don't hesitate to open an issue or a discussion if you think you've found a bug, have a feature request, or just want to say hi!
You can also email at [email protected].