Skip to content

ahgamut/regi-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regi_py

This repo contains a C++ implementation of the game mechanics of the card game regicide, with Python wrappers via pybind11.

Installation

Install this package via Python's pip tool on the command line:

# activate anaconda/uv/whatever for Python env
git clone https://github.com/ahgamut/regi-py
cd regi-py
python3 -m pip install -e .

Viewing a basic simulation

Run the driver.py to see a basic command-line simulation of the game, where each player randomly selects a valid move to play.

# install the package first
python driver.py

To use custom strategies available in the package, specify them with --add-bot:

python driver.py --help # view options for bots
python driver.py --add-bot damage --add-bot preserve

Playing with a bot

Run webdriver/driver.py to play a 2-player game with a bot that picks random moves

# install the package first
cd webdriver
python driver.py
# go to http://localhost:8888 in your browser

Adding your own strategies

Subclass the BaseStrategy class with your own implementations that select what attack/defense moves to make.

About

C++ implementation + Python bindings for mechanics of the card game Regicide

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published