A Python 3 minesweeper generator module
Project description
![minesweeperPyLogo](https://stshrewsburydev.github.io/official_site/API/ProjectScreenshots/minesweeperPy/minesweeperPyLogo.png "minesweeperPy logo")
The minesweeperPy module for Python 3
=====================================
#### Made by Steven Shrewsbury Dev. (AKA: stshrewsburyDev)
Screenshots:
------------
![RawTerminalUsage](https://stshrewsburydev.github.io/official_site/API/ProjectScreenshots/minesweeperPy/minesweeperPy0001.png "Raw terminal usage")
ChangeLogs:
-----------
Version 1.3 and 1.6
* Added ``BlankIdentifier`` to ``MineGen()`` so you can set custom blank cell identifiers
* Updated help information for the module
Version 1.4 and 1.5 had some major problems so the new version is 1.6
Installation:
-------------
###### Install with pip:
```
pip install minesweeperPy
```
###### Install from source:
```
python setup.py install
```
Using in your code:
-------------------
###### Import the module:
```py
import minesweeperPy
```
###### Make a new grid generation setting:
```py
columns = 12 # This will be the amount of columns in the grid (Must be 5+)
rows = 12 # This will be the amount of rows in the grid (Must be 5+)
MyNewGridGenerator = minesweeperPy.MineGen(columns, rows)
```
The number of cells in the grid is calculated by multiplying the column count by the row count:
| Columns | Rows | Cells |
|:-------:|:----:|:-----:|
| 10 | 10 | 100 |
| 25 | 20 | 500 |
| 48 | 50 | 2400 |
###### Generate a new grid:
```py
NumberOfMines = 25 # This will be the number of mines in the grid
#(Must be 1+ and not be more than the maximum space on the Grid generation
# (For example a 10x12 grid would have a maximum of 120 cells))
MyNewMinesweeperGrid = MyNewGridGenerator.GenerateGrid(NumberOfMines)
```
###### Output grid:
```py
>>>print(MyNewMinesweeperGrid)
{
'grid': [['2', 'M', '1', '1', 'M'],
['M', '2', '1', '1', '1'],
['2', '2', ' ', ' ', ' '],
['M', '2', ' ', ' ', ' '],
['M', '2', ' ', ' ', ' ']
],
'BlankIdentifier': ' '
}
>>>for row in MyNewMinesweeperGrid["grid"]:
... print(row)
...
['2', 'M', '1', '1', 'M']
['M', '2', '1', '1', '1']
['2', '2', ' ', ' ', ' ']
['M', '2', ' ', ' ', ' ']
['M', '2', ' ', ' ', ' ']
>>>
```
###### Get grid information:
```py
>>>minesweeperPy.GridInfo(MyNewMinesweeperGrid)
{
'GridColumns': 5,
'GridRows': 5,
'MineCount': 5,
'NonMineCells': 20,
'EmptyCells': 9,
'NumberedCells': 11
}
>>>
```
###### Generate a new grid generation with a custom blank identifer
```py
>>>columns = 12 # This will be the amount of columns in the grid (Must be 5+)
>>>rows = 12 # This will be the amount of rows in the grid (Must be 5+)
>>>customIdentifier = "/" # This will be the cell identifier in the grid (Must be a string value)
>>>NumberOfMines = 25 # This will be the number of mines in the grid
>>>MyNewGridGenerator = minesweeperPy.MineGen(columns, rows, customIdentifier)
>>>MyNewMinesweeperGrid = MyNewGridGenerator.GenerateGrid(NumberOfMines)
>>>print(MyNewMineSweeperGrid["grid"])
[['2', 'M', '1', '1', 'M'],
['M', '2', '1', '1', '1'],
['2', '2', '/', '/', '/'],
['M', '2', '/', '/', '/'],
['M', '2', '/', '/', '/']
]
```
###### Links:
* [GitHub repository page](https://github.com/stshrewsburyDev/minesweeperPy)
* [The module PyPi site](https://pypi.org/project/minesweeperPy/)
* [The stshrewsburyDev official site](https://stshrewsburydev.github.io/official_site/)
The minesweeperPy module for Python 3
=====================================
#### Made by Steven Shrewsbury Dev. (AKA: stshrewsburyDev)
Screenshots:
------------
![RawTerminalUsage](https://stshrewsburydev.github.io/official_site/API/ProjectScreenshots/minesweeperPy/minesweeperPy0001.png "Raw terminal usage")
ChangeLogs:
-----------
Version 1.3 and 1.6
* Added ``BlankIdentifier`` to ``MineGen()`` so you can set custom blank cell identifiers
* Updated help information for the module
Version 1.4 and 1.5 had some major problems so the new version is 1.6
Installation:
-------------
###### Install with pip:
```
pip install minesweeperPy
```
###### Install from source:
```
python setup.py install
```
Using in your code:
-------------------
###### Import the module:
```py
import minesweeperPy
```
###### Make a new grid generation setting:
```py
columns = 12 # This will be the amount of columns in the grid (Must be 5+)
rows = 12 # This will be the amount of rows in the grid (Must be 5+)
MyNewGridGenerator = minesweeperPy.MineGen(columns, rows)
```
The number of cells in the grid is calculated by multiplying the column count by the row count:
| Columns | Rows | Cells |
|:-------:|:----:|:-----:|
| 10 | 10 | 100 |
| 25 | 20 | 500 |
| 48 | 50 | 2400 |
###### Generate a new grid:
```py
NumberOfMines = 25 # This will be the number of mines in the grid
#(Must be 1+ and not be more than the maximum space on the Grid generation
# (For example a 10x12 grid would have a maximum of 120 cells))
MyNewMinesweeperGrid = MyNewGridGenerator.GenerateGrid(NumberOfMines)
```
###### Output grid:
```py
>>>print(MyNewMinesweeperGrid)
{
'grid': [['2', 'M', '1', '1', 'M'],
['M', '2', '1', '1', '1'],
['2', '2', ' ', ' ', ' '],
['M', '2', ' ', ' ', ' '],
['M', '2', ' ', ' ', ' ']
],
'BlankIdentifier': ' '
}
>>>for row in MyNewMinesweeperGrid["grid"]:
... print(row)
...
['2', 'M', '1', '1', 'M']
['M', '2', '1', '1', '1']
['2', '2', ' ', ' ', ' ']
['M', '2', ' ', ' ', ' ']
['M', '2', ' ', ' ', ' ']
>>>
```
###### Get grid information:
```py
>>>minesweeperPy.GridInfo(MyNewMinesweeperGrid)
{
'GridColumns': 5,
'GridRows': 5,
'MineCount': 5,
'NonMineCells': 20,
'EmptyCells': 9,
'NumberedCells': 11
}
>>>
```
###### Generate a new grid generation with a custom blank identifer
```py
>>>columns = 12 # This will be the amount of columns in the grid (Must be 5+)
>>>rows = 12 # This will be the amount of rows in the grid (Must be 5+)
>>>customIdentifier = "/" # This will be the cell identifier in the grid (Must be a string value)
>>>NumberOfMines = 25 # This will be the number of mines in the grid
>>>MyNewGridGenerator = minesweeperPy.MineGen(columns, rows, customIdentifier)
>>>MyNewMinesweeperGrid = MyNewGridGenerator.GenerateGrid(NumberOfMines)
>>>print(MyNewMineSweeperGrid["grid"])
[['2', 'M', '1', '1', 'M'],
['M', '2', '1', '1', '1'],
['2', '2', '/', '/', '/'],
['M', '2', '/', '/', '/'],
['M', '2', '/', '/', '/']
]
```
###### Links:
* [GitHub repository page](https://github.com/stshrewsburyDev/minesweeperPy)
* [The module PyPi site](https://pypi.org/project/minesweeperPy/)
* [The stshrewsburyDev official site](https://stshrewsburydev.github.io/official_site/)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
minesweeperPy-1.6.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for minesweeperPy-1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09c98ed5e24a8b83d37023b75076b02311147757d3c260a6300c3ec5cbfe0abc |
|
MD5 | 4ad30fbf967933f5639e8d9b78dd970e |
|
BLAKE2b-256 | d3374df34859352f35e84a5c7c09e284bc2111cbbb843ed792aa445c31576aa4 |