Skip to main content

Universal package for all the dumb things which we bots do

Project description

🤖 DumbBots: Chain Reaction 🎮


📥 Installation

To install the dumbbots 📦, follow these steps:

  1. Install the package using pip:
    pip install dumbbots
    

🛠️ Usage

Here’s how you can get started:

📜 Import the Game

from dumbbots.chain_reaction import ChainReaction

🔧 Initialize the Game

# Create a 5x5 grid for the game
length, width = 5, 5
chain_reaction = ChainReaction(length, width)

➕ Add Dots to the Board

# Add a dot for Player 1 at position (2, 3)
chain_reaction.add_dot(2, 3, player_no=1)

# Add a dot for Player 2 at position (4, 4)
chain_reaction.add_dot(4, 4, player_no=2)

✅ Check Game Status

# Check if the game is over
winner = chain_reaction.check_game_over()

if winner == -1:
    print("The game is ongoing!")
elif winner == 0:
    print("No winner yet!")
else:
    print(f"Player {winner} wins!")

🔁 Example Game Loop

Here’s an example loop for two players:

while True:
    for player in [1, 2]:
        y, x = map(int, input(f"Player {player}, enter y and x: ").split())
        chain_reaction.add_dot(y, x, player_no=player)

        winner = chain_reaction.check_game_over()
        if winner != -1:
            if winner == 0:
                print("It's a draw!")
            else:
                print(f"Player {winner} wins!")
            break

    if winner != -1:
        break

🛠️ Requirements

  • 🐍 Python 3.7+

📜 License

This project is licensed under the MIT License. See the LICENSE file for more details.


🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests.


📧 Contact

For questions or feedback, please reach out to your_email@example.com.


🎮 Happy Gaming!

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

dumbbots-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

dumbbots-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dumbbots-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for dumbbots-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bc724c515a05043421b1f628bb4adec7f140aa27bf9359d77efebf69b5628bf0
MD5 ee84187016f95521193fc13798e59751
BLAKE2b-256 aac03f7ef74b758614c35c4ffcbc1a9a662d3bf65219b5781a43a17c579b7ef6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dumbbots-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for dumbbots-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a124bbc981f3bfef8a98c87674e84dceaac8181457b46fe3800601df61315ddb
MD5 d57eb901b51cb59ad7f7ff21287d2fbf
BLAKE2b-256 8bb029774c0ca7cbb098a20d8c782a5f1686abbe70c004cf80aeaae079e98788

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