Skip to main content

Terminal based Minesweeper using curses. Includes a self playing AI.

Project description

pmine

Example code in Python 2.7+ / Python 3.6+ using only the standard library.

This is a terminal app that is installed as pmine. It requires support for UTF-8 and curses. Entry point is in minesweeper_cli.py. Use the -h option to print help.

Usage: pmine [difficulty [width [height]]] [-h] [-d] [-a]

  difficulty  Integer between 0 and 40 inclusive.
  width       Integer greater than 1.
  height      Integer greater than 1.

Options:
  -h  HelpDisplays this help message.
  -d  DebugDisplays complete call stacks on errors.
  -a  AutoEnables AI player to play 20 boards.

In game:
  Use the arrow keys or [hjkl] to move.
  Press [f] to flag a mine under cursor.
  Press [space] to reveal from under the cursor.
  Press [q] to quit the game.

There are no commands when AI player is enabled.

Example:
> pmine 3 32 16 -a

  This will have the AI player attempt 32x16 boards moderately packed
  with mines.

Title Hidden Board Active Board Defeat

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmine-1.0.4.tar.gz (140.3 kB view hashes)

Uploaded Source

Built Distribution

pmine-1.0.4-py3-none-any.whl (12.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page