Skip to main content

No project description provided

Project description

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)
  • CardSuit that can be: Spades, Hearts, Diamonds, Clubs or None.
  • CardValue that can be Ace...King or the special value Jester.

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.

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

regicide-0.1.4.tar.gz (22.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

regicide-0.1.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (4.0 MB view details)

Uploaded PyPymanylinux: glibc 2.5+ x86-64

regicide-0.1.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.5+ x86-64

regicide-0.1.4-cp310-none-win_amd64.whl (270.2 kB view details)

Uploaded CPython 3.10Windows x86-64

regicide-0.1.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.5+ x86-64

regicide-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (945.1 kB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

regicide-0.1.4-cp39-none-win_amd64.whl (270.4 kB view details)

Uploaded CPython 3.9Windows x86-64

regicide-0.1.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.5+ x86-64

regicide-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (947.0 kB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

regicide-0.1.4-cp38-none-win_amd64.whl (270.3 kB view details)

Uploaded CPython 3.8Windows x86-64

regicide-0.1.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.5+ x86-64

regicide-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (945.4 kB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

regicide-0.1.4-cp37-none-win_amd64.whl (270.1 kB view details)

Uploaded CPython 3.7Windows x86-64

regicide-0.1.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.5+ x86-64

regicide-0.1.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (945.3 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: regicide-0.1.4.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.18

File hashes

Hashes for regicide-0.1.4.tar.gz
Algorithm Hash digest
SHA256 474c63f80210388346497e0af846a4d52a5c0f42db86edb1b2528f9eb641c229
MD5 f1ba4ffdc8310f93094fa07c3118e834
BLAKE2b-256 352cf6e47ae9416383672a79d5278cef8b35e80864cda0005294c28296212422

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 cc8b6b17b539ee86b5528c804259d50f6f57ce52858bd587c381f703ddd2353e
MD5 5084a6fb0de5f1145166e7865920914f
BLAKE2b-256 10a5c31e5ae78db80977b78661bc139a14ea8a06cc4a5429f96da44f61007454

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3073946068b49cb1f6c8ad2d5112bbbe293ae8155b23983ff536ad87dc2601ab
MD5 20436611b7fdee08aaf1f43c7c0a5894
BLAKE2b-256 6bbbd35a075cf82c9c8c31196f84d1209b3c00126df91936eef8dbc3294e48ad

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp310-none-win_amd64.whl.

File metadata

  • Download URL: regicide-0.1.4-cp310-none-win_amd64.whl
  • Upload date:
  • Size: 270.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.18

File hashes

Hashes for regicide-0.1.4-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 f2bd20c1cb39d3757648ff371803397b72930f88996c909b0497561be1250efc
MD5 97a06a9bd318a9ae97ae768acd0999b4
BLAKE2b-256 df15b5f03c6158d4ec4f02b067c91698797d0685c6488c6cd77326e0e474ff6f

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5aee57493a594ffc775d64674236417593382593fa1e25e3fa8b88c8c12f3ec0
MD5 4dee7f35ac1438cd9b3923622897ebba
BLAKE2b-256 457e6a17061ea108fc021e716ee84c345594c6726b71b36a58b0ddee93be36ae

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 13b3db070a5d3f16d73c8f87d02fa0e251841105ab3c7cf4da88e862033816f6
MD5 2b512fb4cc4eeafe79e47b48ba4b194e
BLAKE2b-256 f016df762d4383efcccd74091df962bbb3db15c6a60619563f1491404f79af73

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp39-none-win_amd64.whl.

File metadata

  • Download URL: regicide-0.1.4-cp39-none-win_amd64.whl
  • Upload date:
  • Size: 270.4 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.18

File hashes

Hashes for regicide-0.1.4-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 adf87a3664f34e29adee4a5821e98cf726f4fb1ba816f4695d8e42371bf60af4
MD5 87193fffd4bc846f7b95269e41167e2e
BLAKE2b-256 17ad1ea69fec2161b5776ae962304658dd66fb26983bfaf033bc01caf1d0ebfc

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 867dd248338aea93a49bdd8aa89f00ba8dde214c91014891391e58485edf21de
MD5 82037f9e34c6fd6fe6e2625a4670d90e
BLAKE2b-256 839800bb4c7a9ec98fc14404093083192092be18010e9842cb1c5329bf6eac33

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 16afaab8ba9e6fc96f50f127f050669610d94faa70fab2d02cca92ee315ab56a
MD5 cacb31cec9522bc42cfd4e06d94bc7be
BLAKE2b-256 fb2c393d6a88d39c55554f1fe486d2a10b144bdda1fb53f618095b185471e470

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp38-none-win_amd64.whl.

File metadata

  • Download URL: regicide-0.1.4-cp38-none-win_amd64.whl
  • Upload date:
  • Size: 270.3 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.18

File hashes

Hashes for regicide-0.1.4-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 1092cff3a6d4c8faf6a181b5d7c9e2435dbb4ce762006808491f1d6d21f736a9
MD5 bb3b56c5a29ef5238a3610210b078aa9
BLAKE2b-256 d5c0b1c9aedd6bc26252c60c3c454b437eaad388bd47d6f93165c4157017385b

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ca22deda339d2c2b8b645d0cf510c7638a1a2a66e7fbbed91f9ba9cafaaa8716
MD5 b3cf13befcceaa2751a26069caf7c14b
BLAKE2b-256 53e36ea48512e9e189132bb85d716eac89a2e7f181ed0921da6939499dccef6e

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 62c8db068fb7c423ea68780bb1b4c07ba11cbd4381777f927cf976de79b2a74d
MD5 c3f6fd5eaa00633f6692e6cb95801433
BLAKE2b-256 aba8e0cb28819a2d73e9f3490c6806656c971566a4cbd04f7fe265998a414bb6

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp37-none-win_amd64.whl.

File metadata

  • Download URL: regicide-0.1.4-cp37-none-win_amd64.whl
  • Upload date:
  • Size: 270.1 kB
  • Tags: CPython 3.7, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.12.18

File hashes

Hashes for regicide-0.1.4-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 1d716a6eaaaf36cfa0cf230fffff4f9a65005de0f0ffba3ec7ca92ef6abeb24b
MD5 878f1e308424bd1e5e43daac70a8fd51
BLAKE2b-256 19d2aa473d90baa5aabe4d460b103b2542b22e61b146831d818274de3672b4c5

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 36a3c9e84edb97d29e924966df79cbf6963773de9b80f685b7101257df5273c2
MD5 450e115e910594668e3dcc41f6fcdd74
BLAKE2b-256 671805b87f19657c3b64f276d20882ee82b9194e29752421a5fda343e4c5b5b9

See more details on using hashes here.

File details

Details for the file regicide-0.1.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for regicide-0.1.4-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d7c6c0d4a3d517cf7374b6ad26d5c77d62a26dd097002a2379611184d2feebf8
MD5 0ad2a02cf9d176166081c6009a44a393
BLAKE2b-256 4f8efe4d3b525894300cfceeeecb60f270c796880f718da930a998594cbf9db4

See more details on using hashes here.

Supported by

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