Skip to content

igor47/sweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sweeper

This is a basic ncurses minesweeper game. It is written in Python, using the awesome curtsies library for interacting with the terminal.

Running

This is a single-file script that uses PEP 723 inline metadata, so uv handles everything — Python version, virtualenv, and dependencies — on first run.

$ ./sweeper.py

Or, equivalently:

$ uv run sweeper.py

Interface

The following commands are supported:


Key Action
h Display in-game help menu
c Close any open in-game menu
l Pick difficulty level
n Start a new game

While a game is in-progress, use the arrow keys (←,↑,→,↓) to move the cursor around the mine field. Hit <SPACE> to open the cell under the cursor. Hit f to flag a cell as a mine. Hitting <SPACE> on an already-opened clue cell will highlight adjacent cells. If the number of neighboring cells that are flagged equals the value of the clue, then all remaining unflagged cells will be opened.

Screenshot

TODO

I wanted to implement a version of sweeper where you don't have to guess, but this turned out to be more complicated than I thought.

About

ncurses minesweer using python3 + curtsies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages