Python implementation of MarjaPussi, mostly following the rules from Wurzel e. V., exactly following the rules on marjapussi.de.
This package is used by the backend of marjapussi.de.
python -m pip install git+https://github.com/SamuelLess/marjapussi.git
Installation inside docker containers will not work with the slim
tag due to missing git support.
from marjapussi.game import MarjaPussi
game = MarjaPussi(['Name1', 'Name2', 'Name3', 'Name4'])
log = [True | False | 'DEBUG')
: sets printlevel forgame.logger
.fancy = [True | False]
: enable color output using ANSI escape sequencesoverride_rules
: dict overriding entries inMarjaPussi.DEFAULT_RULES
while not game.phase == "DONE":
legal_actions = game.legal_actions()
#choosing an action
action = random.choice(legal_actions)
#returns True at success
game.act_action(action)
You are more than welcome to send pull requests or simply talk to me if you think something is wrong or could be done more pythonic.