Regicide
A framework for playing the card game Regicide.
Requirements
The package requires python version 3.7+ and should be compatible with Linux, Windows and macOS.
Installation
The Regicide framework can be installed in python using pip.
$ pip install regicide
Usage
Example
The following is an example of implementing an agent with custom behavior. In this example the agent will always choose to play the six of diamonds if available. Otherwise, it will choose randomly from the available actions.
import random
import regicide
from regicide import actions, card, players
class CustomPlayer:
"""
A player that always plays the Six of Diamonds if possible.
Otherwise it will choose a random action.
"""
def play(self, state):
legal_actions = state.action_space()
c = card.Card(card.CardSuit.Diamonds, card.CardValue.Six)
special_action = actions.ActionPlay(c)
if special_action in legal_actions:
return special_action
else:
return random.choice(legal_actions)
players = [CustomPlayer(), CustomPlayer(), CustomPlayer()]
game = regicide.RegicideGame(players, seed=1337)
result = game.playout()
print(result, game.reward())
API
The framework has three submodules: \cd{actions}, \cd{card} and \cd{players}. Each module contains python classes that can be instantiated and used in the framework.
Actions
Available actions are:
Play(card: Card)AnimalCombo(cards: List[Card])Combo(cards: List[Card])Yield()Discard(cards: List[Card])ChangePlayer(id: int)RefillHand
Cards
Available cards are:
Card(suit: CardSuit, value: CardValue)CardSuitthat can be:Spades,Hearts,Diamonds,ClubsorNone.CardValuethat can beAce...Kingor the special valueJester.
Players
InputPlayer()that allows user input for taking actions.RandomPlayer(seed: int)MCTSPlayer(playouts: int, num_threads: int, uct_variation: int, use_heuristics: bool)
Caveats
Currently, the python package does not support code suggestions in IDE's, making it more difficult to work with the package. This is a result of the method used to generate the python bindings and has no implication on actual performance or correctness of the program.
Metadata
Release files for regicide 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| regicide-0.1.5.tar.gz | 22.6 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 29.4 MB
Release files / regicide-0.1.5.tar.gz
| Download URL | regicide-0.1.5.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f25a3fa2229b15539b1c374e6fd7eb2588c581a0c72695f749d3338f09581fd9
|
|
BLAKE2b-256 checksum How to use checksums |
6f7c7fe53d4da3e6fd9e77f028eef889530af331b7b2d0ef6a45eab5c4e193d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | regicide-0.1.5-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | Linux glibc 2.5+ x86-64 PyPy 3.7 PyPy 3.7 7.3 |
|
SHA-256 checksum How to use checksums |
8d74b886f96f9abb79ba576c18aff06eb5b0009178774016c03e67ed4f411746
|
|
BLAKE2b-256 checksum How to use checksums |
2973c79a96a8c11401efb10c0b9cf12b57b1c887ea96e78fb91b976910aa92ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | regicide-0.1.5-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.11 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
1d96989f4bf6492a1421228f8482d0db25839a42f266c8552ebc2c5edc5250d3
|
|
BLAKE2b-256 checksum How to use checksums |
d19b61057285d7b7de39e4c11a89cb08a178dfbd642174fa9b7fcef8c6fac181
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp310-none-win_amd64.whl
| Download URL | regicide-0.1.5-cp310-none-win_amd64.whl |
|---|---|
| Size | 277.4 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
734cd75f0b5fb252af083d27f125d0d0cf8ba6c4b77eeb4cf278355d4e93a64b
|
|
BLAKE2b-256 checksum How to use checksums |
50b4803682bb2ef2fbab92b9b94c19ed1308c49695f6597b62993f8199600735
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | regicide-0.1.5-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.10 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
9e7243b1123b78b333981615a01bc8b3d55f7600b093ee4524cb9546281103a8
|
|
BLAKE2b-256 checksum How to use checksums |
b604eaea35792ddb551f88de72aaa649656e147bfb1f587ae594ee4a5ea75f55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | regicide-0.1.5-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 962.8 kB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
84c972fb6926bf4bf784911d752a85b9502815dc9436ee6eea59015340b8d4c9
|
|
BLAKE2b-256 checksum How to use checksums |
51452533311d8287d9573873485c8f5fdd14da790c76bd2e18a68dc0ec43ea9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp39-none-win_amd64.whl
| Download URL | regicide-0.1.5-cp39-none-win_amd64.whl |
|---|---|
| Size | 277.7 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
09db5d700ca8f1102a9dcc482a4d7ab4bc487833e6f2f09b5535af1d17450ea5
|
|
BLAKE2b-256 checksum How to use checksums |
1df9fa06625ef3b774409d63b08d91e0e96689d83546a97c9897f8af00554159
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | regicide-0.1.5-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.9 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
df34b0c43256c9802d33da553d1cb71b9e5f7c9d39912f033f5e3129270fa0fd
|
|
BLAKE2b-256 checksum How to use checksums |
c61c5412bcac1cbc68d1ed5e93e0cecb651ce9c9e920cc16004ebd1c87c04575
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | regicide-0.1.5-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 964.7 kB |
| Tags | CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
25c767d89dfed679f6b6f347b9a9fcfdda37f66ff38995de60ae117c89f5c983
|
|
BLAKE2b-256 checksum How to use checksums |
6f08e4df63fab698bf24073dd47184ea29b384d677cd4aa5743dd630379eecc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp38-none-win_amd64.whl
| Download URL | regicide-0.1.5-cp38-none-win_amd64.whl |
|---|---|
| Size | 277.7 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
dac8d97779e4291308007cae348ac088f0fd8d260f9eb2488a8fae82337edc6f
|
|
BLAKE2b-256 checksum How to use checksums |
e41455fae44994fb1ab9ac712c80f14f96b7a007b9c09d5f1048e4b23c4af44f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | regicide-0.1.5-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.8 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
736cb88c44e4a9d491793a1b0f30c26f0da7580b64e2d39d35e4f76619b6dc37
|
|
BLAKE2b-256 checksum How to use checksums |
33fcdd13520534a0ffa681b8b58da49a8ccec283d72ffc86e21f26035cdb1db5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | regicide-0.1.5-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 963.2 kB |
| Tags | CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
54d2256f7f21ca95a37604f405e1a0e72b9466f3f92f57979f2850dbcc567c8e
|
|
BLAKE2b-256 checksum How to use checksums |
3e6e1a41ed352c2f2b8ce6f183fc9d92b93ac3097917a1149b4cec2223f5d68a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp37-none-win_amd64.whl
| Download URL | regicide-0.1.5-cp37-none-win_amd64.whl |
|---|---|
| Size | 277.5 kB |
| Tags | CPython 3.7 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3bd641551ff9b47fea0ee64c08fd5d3c58b285375b36c360dd86094b40628873
|
|
BLAKE2b-256 checksum How to use checksums |
bb06a951f363a92a5a1ace1180d5e471d4976fbea4e51cc3b012e1742fbbd2f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
| Download URL | regicide-0.1.5-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
c2468f8b1afb5bddd5e93910812bc67d218c5df1fb01a8e7154c6596f314dfa9
|
|
BLAKE2b-256 checksum How to use checksums |
ddb08cae667a94430eb85f259f22059e8bfa989a80c5d479ba3381c0d18774d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Release files / regicide-0.1.5-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | regicide-0.1.5-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 963.4 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c0fd67a8f17aea93e7593c6d3372b0f1dcb174491857bdfe96acc11a49ccfc4b
|
|
BLAKE2b-256 checksum How to use checksums |
08475f46c390dcfd55f0f251c2f5cb207958bcba0e1040f5ec31e9209ae8d488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/0.12.19
|
Security for regicide 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.