Skip to main content

Build Status PyPI - License PyPI Downloads

Minesweeper

Minesweeper is a single-player puzzle computer game. The objective of the game is to clear a rectangular board containing hidden "mines" or bombs without detonating any of them, with help from clues about the number of neighboring mines in each field. The game originates from the 1960s, and has been written for many computing platforms in use today. It has many variations and offshoots.

This simple implementation of minesweeper is done in Python using the game library pygame.

The core functionality of the game can be found here and the python package for the sprite sheet can be found here

Motivation

The motivation of these minesweeper projects is to learn the tooling around python projects, how to create CI/CD pipelines for python projects, and distributing python eggs.

Getting Started

Installation

python -m pip install pygame-minesweeper
# or
pip install pygame-minesweeper

Start a game

# if $HOME/.local/bin/ is defined in $PATH
minesweeper <basic | intermediate | expert | custom>
# or
python -m minesweeper <basic | intermediate | expert | custom>`

Boards

scheme rows cols mines
Basic 10 10 10
Intermediate 16 16 40
expert 6 30 99
custom --rows --cols --mines

Show high Score

minesweeper --show-high-score
# or
python -m minesweeper --show-high-score
# Stdout

BASIC
-----
#01 0:00:22.641516
#02 0:00:29.936435
#03 0:01:02.104885
#04 -
#05 -
#06 -
#07 -
#08 -
#09 -
#10 -

CUSTOM 10X10:5
-----
#01 0:00:15.618247
#02 -
#03 -
#04 -
#05 -
#06 -
#07 -
#08 -
#09 -
#10 -

Start a game with a different sprite sheet

The --tile-sprite, --face-sprite, and --score-sprite parameters define a set of sprite sheets that are available from this python package.

# if $HOME/.local/bin/ is defined in $PATH
minesweeper -h
# or
python -m minesweeper -h
#stdout
positional arguments:
  {basic,intermediate,expert,custom}

optional arguments:
  -h, --help            show this help message and exit
  --rows ROWS
  --cols COLS
  --mines MINES
  --tile-sprite {2.0,2.9,95,2000,fiorito-2000,fiorito-monochrome,fiorito-xp,monochrome}
  --score-sprite {2000,monochrome}
  --face-sprite {2000,monochrome}
  --sprite {2000,monochrome}
  --show-high-score

If the --sprite flag is set it will override the other flags like --tile-sprite, --score-sprite and --face-sprite.

# Starting an *Expert* game with a full monochrome spritesheet
minesweeper expert --sprite=monochrome
# or
python -m minesweeper expert --sprite=monochrome

monochrome

Credits

Sprites

The sprites used in this project were created by Black Squirrel and can be found here.

TODO

  • Refactor Project

References

Metadata

Release files for pygame-minesweeper 1.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygame-minesweeper 1.0.11
File Size Uploaded
pygame-minesweeper-1.0.11.tar.gz 10.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygame-minesweeper 1.0.11
File Interpreter ABI Platform
pygame_minesweeper-1.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / pygame-minesweeper-1.0.11.tar.gz

Download URL pygame-minesweeper-1.0.11.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
47e7752793d32d8d7c8066f46d7d7bc2333b6ca404bbacc3de018801c821505d
BLAKE2b-256 checksum
How to use checksums
82aab40c22ebcdfab7c0b164c21a3709968288da6d952809182718bf04671589
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

Release files / pygame_minesweeper-1.0.11-py3-none-any.whl

Download URL pygame_minesweeper-1.0.11-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0abfe13e04374dd339e86ce84a672984f0d9abcacf1bd27a52bb74fa24ab0b0
BLAKE2b-256 checksum
How to use checksums
73b1a834e4c214d7fe698f3a92d15eb98c344ed1a5c034e29ca38331c06a4f9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.6.12

Release history Release notifications | RSS feed

This release

1.0.11 This release

2 release files

1.0.10

2 release files

1.0.8

2 release files

1.0

2 release files

0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page