Par Infinite Minesweeper
Project description
Par Infinite Minesweeper
Description
Infinite Minesweeper TUI. Play a game of minesweeper with infinite board size!
Screenshots
Technology
- Python
- Textual
- Sqlite3
- OAuth2 (For Internet Leaderboard)
Key Features:
- Infinite board size
- Local high scores
- Internet high scores
- Auto saves and can be resumed
Objective
The goal of the game is to uncover all the cells that do not contain mines. If you uncover a mine, you lose the game. Your 1st click is always safe. If you uncover a cell that is not a mine, it will show a number indicating how many mines are in the neighboring cells. Use this information to determine which cells are safe to uncover.
Controls
- Left click to uncover a cell. If a cell is flagged as a mine, it will not be uncovered.
- Sub grids can only be unlocked when cells neighboring the sub grid are uncovered.
- Shift or Ctrl + Left-click to toggle flagging a covered cell as a mine.
- Shift or Ctrl + Left-click on an uncovered cell it will uncover all neighboring cells.
- As a safety you must have same number of flags as mines in the neighboring cells.
- Drag to pan the board.
- Keys:
F1Help.NNew game.OMove view to origin.CMove view to board center (computed as center of exposed sub grids).PPause.SToggle highlighting of sub grid under the mouseHHighscores.TChange theme.QQuit.
Scoring
The main grid consists of 8x8 sub grids.
When all cells that are not mines in a sub grid are uncovered the sub grid is marked solved turns a darker gray and flags are placed on any mines that are not already flagged.
- Easy: 8 mines
- Medium: 12 mines
- Hard: 16 mines
When all cells that are not mines in a sub grid are uncovered the sub grid is marked solved and flags are placed on any mines that are not already flagged.
Your score is the sum of all mines in the solved sub grids.
Storage
All data for the application is stored in a sqlite3 database located in $XDG_DATA_HOME/pim or appropriate folder for your OS
The database is backed up each day you play to game_data.sqlite.bak
Internet Leaderboard
To use the internet leaderboard you must login to the server via a social provider such as google or facebook.
This requires 2 things:
- The game must listen on port 1999 for the authentication callback. (This may trigger a firewall warning which you must accept if you wish to continue)
- The game must launch a browser so you can login.
- Only your hashed email is stored on the server.
- The port will only be opened for the duration of the login process.
- After you have logged in and reserved your nickname, you can then submit your scores to the server for the current game mode and difficulty.
- Nicknames may only contain the chars a-z A-Z 0-9 and . - _
- Only one score per user / game mode / difficulty is stored.
- You may submit scores for games that have not yet ended. If the score is higher than your existing one it will replace it.
- Scores are not posted to the internet automatically, so make sure you post your score before starting a new game!
See our privacy policy for details on data handling.
Prerequisites
The instructions assume you have uv installed.
Installation
PyPi
uv tool install par_infini_sweeper
GitHub
uv tool install git+https://github.com/paulrobello/par_infini_sweeper
Update
PyPi
uv tool install par_infini_sweeper -U --force
GitHub
uv tool install git+https://github.com/paulrobello/par_infini_sweeper -U --force
Installed Usage
pim [OPTIONS]
From source Usage
uv run pim [OPTIONS]
CLI Options
--server -s Start webserver that allows app to be played in a browser
--user -u TEXT User name to use [default: logged in username]
--nick -n TEXT Set user nickname [default: None]
--version -v Show version and exit.
--help Show this message and exit.
Roadmap
- More game modes
- Optimize for more performance
Whats New
- Version 0.3.3:
- Subgrids now have subtle checker background
- Added
Skey to toggle subgrid highlighting - Fixed bug where hitting mine on 1st click after reloading game did not end game
- Version 0.3.2:
- Ensure 1st click is always safe
- Version 0.3.1:
- Use XDG specification for data paths
- Version 0.3.0:
- Fix server mode not using other parameters such as user and nick
- Limit username and nickname to no more than 30 characters
- Fix help dialog content display issues
- Added internet leaderboard!
- Added
akey to access authentication dialog for internet leaderboard
- Version 0.2.10:
- Updated package metadata
- Removed some unnecessary dependencies
- Version 0.2.9:
- Fixed some first run db issues
- Version 0.2.8:
- Addata game data backup
- Updated readme and help
- Version 0.2.7:
- Added pause key
p - Fixed bug where sometimes newly generated sub grids would not get saved if no cells were uncovered
- More optimizations
- Support for future game modes
- Added pause key
- Version 0.2.6:
- Now only highlights unrevealed surrounding cells when shift/ctrl + left-click on uncovered cells
- Version 0.2.6:
- Now stops timer on game over
- Now highlights surrounding cells when shift/ctrl + left-click on uncovered cells
- Version 0.2.5:
- Disabled some toasts to reduce clutter
- Moved middle click function to shift/ctrl + left-click on uncovered cells
- Version 0.2.3:
- Enabled multi user support
- Version 0.2.0:
- Added webserver to play in a browser
- Version 0.1.0:
- Initial release
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Shoutout
I would like to thank Edward Jazzhands for all his help testing and feedback / feature requests!
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Paul Robello - probello@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file par_infini_sweeper-0.3.3.tar.gz.
File metadata
- Download URL: par_infini_sweeper-0.3.3.tar.gz
- Upload date:
- Size: 29.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cce9c33e8908b2d3316d392eb7a70736ccbb8e154e0ae45421eeaf9093891b49
|
|
| MD5 |
196c753fe5bd7978e3cea7cf42d9af6d
|
|
| BLAKE2b-256 |
69c6a09ab9beab85fd9beaed58aaf9bb447fbcad056ef420777bbdca16f1afa2
|
Provenance
The following attestation bundles were made for par_infini_sweeper-0.3.3.tar.gz:
Publisher:
publish.yml on paulrobello/par_infini_sweeper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
par_infini_sweeper-0.3.3.tar.gz -
Subject digest:
cce9c33e8908b2d3316d392eb7a70736ccbb8e154e0ae45421eeaf9093891b49 - Sigstore transparency entry: 177565194
- Sigstore integration time:
-
Permalink:
paulrobello/par_infini_sweeper@7df8cb4945f66463d68e1ff1e8eaa2c3de7de63c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/paulrobello
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7df8cb4945f66463d68e1ff1e8eaa2c3de7de63c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file par_infini_sweeper-0.3.3-py3-none-any.whl.
File metadata
- Download URL: par_infini_sweeper-0.3.3-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51fe09ead532a8d047b6c19a75d6890f4d69066724a7cc699e70dd1cb5c49fce
|
|
| MD5 |
7a2f39966cdf4be65a4e324ad62f4392
|
|
| BLAKE2b-256 |
38a057c6dc5975843c40649f8f37655fff8aff809cbec1656117c4e4e52bd970
|
Provenance
The following attestation bundles were made for par_infini_sweeper-0.3.3-py3-none-any.whl:
Publisher:
publish.yml on paulrobello/par_infini_sweeper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
par_infini_sweeper-0.3.3-py3-none-any.whl -
Subject digest:
51fe09ead532a8d047b6c19a75d6890f4d69066724a7cc699e70dd1cb5c49fce - Sigstore transparency entry: 177565202
- Sigstore integration time:
-
Permalink:
paulrobello/par_infini_sweeper@7df8cb4945f66463d68e1ff1e8eaa2c3de7de63c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/paulrobello
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7df8cb4945f66463d68e1ff1e8eaa2c3de7de63c -
Trigger Event:
workflow_dispatch
-
Statement type: