Skip to main content

A Library to make simple minesweeper games using OOP

Project description

Minesweeper

This is a library to make simple minesweeper games using OOP

Example Usage:

from Minesweeper import Board # Import the Board object from the library

b = Board(5, 5) # Create the Board instance
b.place_mines(5) # Place 5 mines on our 5x5 board
while True: # Loop forever
    inp = input("Enter row, column: ") # Take input
    f_or_r = inp[0] # Check if user wants to flag or reveal
    row = int(inp[1:].split()[0]) # Get the row from the input  
    col = int(inp[1:].split()[1]) # Get the column from the input
    if f_or_r == "f": # If input is to flag
        b.flag(row, col) # Use flag() to flag the cell
        print(b.visualize()) # Use visualize() to get a string of the updated board
    elif f_or_r == "r": # If the input is to reveal
        b.reveal(row, col) # Use reveal() to reveal the value of the cell
        print(b.visualize()) # Use visualize() to get a string of the updated board

Made by: Ousama Alhennawi

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

SweeperPy-0.0.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

SweeperPy-0.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file SweeperPy-0.0.1.tar.gz.

File metadata

  • Download URL: SweeperPy-0.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for SweeperPy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 becba37473c57e0f644e364c6719ab6ddb22978486e70fbd184e40682008277b
MD5 181e2f56119bb4fdbd49a4d4a55fe925
BLAKE2b-256 8c77bd61edeaff036aee0d47938696861a3df3ca698cea8f76c7a92f1068e8c7

See more details on using hashes here.

File details

Details for the file SweeperPy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: SweeperPy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for SweeperPy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef0af26ca426b6d3074e0b968fb7c1dcfb6b8fa7b2491fa4286211febc88b15
MD5 a7d636b1f96d21181126cbb5a031790d
BLAKE2b-256 bba0de05a63879263bf322c4478368f581658062ea97a87a38f5ee6a104ba4c2

See more details on using hashes here.

Supported by

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