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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pyminion-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyminion-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 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.10.0

File hashes

Hashes for pyminion-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9710bf1a7b976cbacdd05129d1895fe4f4a675a5d0dfe202fc914b7682a0503d
MD5 f686e8a82996cdf7ad16a98a0dea7bb0
BLAKE2b-256 34168f2c47f21d24816f3abe8e70387ef767b59f6803b1a3e85540c706160bef

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