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 game engine. In addition, it enables interactive games through the command line and simulation of games between bots.

Table of Contents

Getting Started

Pyminion requires Python 3.8 and can easily be installed through pypi

python3 -m pip install pyminion

Usage

To play a game against a bot through the command line:

from pyminion.expansions.base import start_cards, base_cards, basic_cards
from pyminion.players import BigMoney, Human
from pyminion.models.core import Game

# Initialize player and bot
human = Human()
bot = BigMoney()
players = [human, bot]

# Choose expansions to play with
expansions = [base_cards]

# Setup the game
game = Game(players, expansions, basic_cards, start_cards)

# 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 is currently being worked on.

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.4.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

pyminion-0.1.4-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyminion-0.1.4.tar.gz
  • Upload date:
  • Size: 12.3 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.4.tar.gz
Algorithm Hash digest
SHA256 fa5958d8d91f35b890e0db41cc92096ac28ced4f13b75030249ef2f51cf067f8
MD5 d5fbe824e8ed6cb01222c58e80b906bd
BLAKE2b-256 231c6e4dde1020748deff5e55b101282651c239017954ab5ed230e63799345ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyminion-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.1 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 62cbe3d90750476f3c006291fde37044706c359bc80451d669fa5343fbbc84c0
MD5 f8d3ac6ec04a8cd824993065c3b06fa5
BLAKE2b-256 8e81e920580d570a28ad741a472b0141992569e95bef0b1e82bdcff563ec332f

See more details on using hashes here.

Supported by

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