Skip to main content

Dominion but make it python

Project description

Pyminion

Pyminion is a library for executing and analyzing games of Dominion. At its core, pyminion implements the rules and logic of Dominion and provides an API to interact with the core game engine. In addition, it enables interactive games through the command line and simulation of games between bots.

Table of Contents

Installation

pip install pyminion

Usage

To play a game against a bot:

from pyminion.expansions.base import start_deck, core_supply, kingdom_cards
from pyminion.players import BigMoney, Human
from pyminion.models.core import Game, Supply

# Initialize player and bot
human = Human(deck=start_deck)
bot = BigMoney(deck=start_deck)

# Setup the game
supply = Supply(piles=core_supply + kingdom_cards)
game = Game(players=[bot, human], supply=supply)

# Play game
game.start()
while not game.is_over():
    bot.take_turn(game)
    human.take_turn(game)
print("Winner: ", game.get_winner()

Support

Please open an issue for support.

Contributing

The most welcome contributions would be to add more cards from the base set of Dominion or to create new bots that perform better than basic big money strategy. Check the open issues to get a sense of what of what needs to be done.

If you would like to contribute, please create a branch, add commits, and open a pull request.

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

pyminion-0.1.3.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

pyminion-0.1.3-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file pyminion-0.1.3.tar.gz.

File metadata

  • Download URL: pyminion-0.1.3.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for pyminion-0.1.3.tar.gz
Algorithm Hash digest
SHA256 50fea9716322f1e81847359c9a452d77223470f6d967aef62d38972fbf684648
MD5 618b7c451e66da4ac51e298d3bb335c9
BLAKE2b-256 39363bd109886229f0a77bf98d75c0ecc6fb9767aa0e50f3d06900d568abc9d0

See more details on using hashes here.

File details

Details for the file pyminion-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pyminion-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.5

File hashes

Hashes for pyminion-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9542cccae4cebd7ef6cdfdbd486133cc69d2d411d0bf675c4573d22460452351
MD5 9ab2901c6bc6e693b332ffa0e12c044e
BLAKE2b-256 310b534df0c77014a8b1f0282c0674ea3dc655da6f87e40b67b6e9329599bd12

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