Skip to content

Commit

Permalink
now available via pip
Browse files Browse the repository at this point in the history
  • Loading branch information
BaibhaVatsa committed Jul 27, 2019
1 parent e134da3 commit 671f1ac
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 11 deletions.
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
# Minesweeper

Implementation of Minesweeper in Python. Written with Python 3.
Implementation of Minesweeper game and agent in Python 3.

## Screenshots

<img src="./screenshots/play.jpg" width="500" alt="A Game of 5x5 Map in progress"/>

A Game of 5x5 Map in progress

<br>
<img src="./screenshots/exportedmap.jpg" width="500" alt="Sample exported 20x20 Map"/>

Sample exported 20x20 Map

## How to Play
## Modules

pyminesweeper
- MinesweeperMap
- Contains the functions to create the minesweeper grid and help connect to a frontend
- MinesweeperUI
- Contains terminal UI for playing the game and functions to create a customised game UI

## Installing

```
pip install python-minesweeper
```
git clone https://github.com/BaibhaVatsa/minesweeper.git
cd minesweeper
./play.py

## How to Play

```python
import pyminesweeper
game = pyminesweeper.MinesweeperUI()
game.run()
```

## Goals
## Planned additions

- [X] board representation
- [X] board generation
Expand All @@ -39,3 +53,9 @@ cd minesweeper
- [X] save progress
- [ ] load maps
- [ ] working agent

## Development

All kinds of contributions are very welcome.
<br>
Source: [python-minesweeper](https://github.com/BaibhaVatsa/python-minesweeper)
2 changes: 1 addition & 1 deletion pyminesweeper/minesweepermap.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_map_str(self) -> str:
if self.map[i][j].state is State.FLAGGED:
map_str += "[|>]\t"
elif self.map[i][j].state is State.REVEALED:
map_str += str(self.map[i][j].val if self.map[i][j].val is not -1 else "[X] ") + "\t"
map_str += ((" " + str(self.map[i][j].val)) if self.map[i][j].val is not -1 else "[X] ") + "\t"
else:
map_str += "[ ] \t"
map_str += "\n"
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import setuptools

with open("README.md", "r") as fh:
with open("README_PyPI.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="python-minesweeper",
version="0.1.0",
version="0.1.1",
author="Baibhav Vatsa",
author_email="[email protected]",
description="Minesweeper module for Python",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 671f1ac

Please sign in to comment.