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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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