diff --git a/README.md b/README.md index b9d1602..ca95239 100755 --- a/README.md +++ b/README.md @@ -1,26 +1,40 @@ # Minesweeper -Implementation of Minesweeper in Python. Written with Python 3. +Implementation of Minesweeper game and agent in Python 3. ## Screenshots A Game of 5x5 Map in progress A Game of 5x5 Map in progress - +
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 @@ -39,3 +53,9 @@ cd minesweeper - [X] save progress - [ ] load maps - [ ] working agent + +## Development + +All kinds of contributions are very welcome. +
+Source: [python-minesweeper](https://github.com/BaibhaVatsa/python-minesweeper) diff --git a/pyminesweeper/minesweepermap.py b/pyminesweeper/minesweepermap.py index 8522e12..5a3d464 100755 --- a/pyminesweeper/minesweepermap.py +++ b/pyminesweeper/minesweepermap.py @@ -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" diff --git a/setup.py b/setup.py index 7371656..ac09ada 100755 --- a/setup.py +++ b/setup.py @@ -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="baibhavvatsa@gmail.com", description="Minesweeper module for Python", long_description=long_description, long_description_content_type="text/markdown",