Skip to main content

figgiebot

Create bots to play the card game Figgie at https://figgie.com/

Installation

Simply run pip install figgiebot. The PyPI package is at https://pypi.org/project/figgiebot/

You will need to install Chromedriver

Dependencies

Usage

For an example algorithm look at example.py

from figgiebot import Bot

bot = Bot()

# <Bot Code>

bot.run(opponent_count=4)

The bot automatically starts new rounds.

Events

There are 6 event decorators. These are called as events happen in the Figgie game. The tick event is called every client tick (by default this is every 10ms + time to execute orders). Suits for figgiebot are "s", "c", "d", "h".

@bot.on_bid()
def on_bid(player, value, suit):
    # <write code here>


@bot.on_offer()
def on_offer(player, value, suit):
    # <write code here>


@bot.on_sold()
def on_sold(seller, buyer, value, suit):
    # <write code here>


@bot.on_bought()
def on_bought(buyer, seller, value, suit):
    # <write code here>


@bot.on_tick()
def on_tick():
    # <write code here>


@bot.on_round_start()
def on_round_start():
    # <write code here>

Game Commands

There are 6 game commands. These use selenium action chains to execute so will slow the client tps.

bot.bid(value, suit)

bot.offer(value, suit)

bot.buy(suit)

bot.sell(suit)

bot.cancel_suit_bids_and_offers(suit)

bot.cancel_all_bids_and_offers()

Game Date

The bot maintains the following up-to-date data of the state of the game.

bot.markets  # Dictionary with {"sell_value": 0, "buy_value": 0} for each suit

bot.hand  # e.g. {"s": 0, "c": 0, "d": 0, "h": 0}

bot.time_remaining  # The time remaining in seconds for the game round

bot.name  # The name of the bot in game

bot.opponents  # A list of names of opponents in the game

bot.opponent_chips  # A dictionary of the number of chips each opponent currently has

bot.chips  # The number of chips the bot currently has

Decks

You can also import from figgiebot figgie_decks which will be useful for your trading algorithm.

figgie_decks = [
    {"s": 12, "c": 8, "d": 10, "h": 10, "majority": 5, "payoff": 120, "goal": "c"},
    {"s": 12, "c": 10, "d": 10, "h": 8, "majority": 6, "payoff": 100, "goal": "c"},
    {"s": 12, "c": 10, "d": 8, "h": 10, "majority": 6, "payoff": 100, "goal": "c"},
    {"s": 8, "c": 12, "d": 10, "h": 10, "majority": 5, "payoff": 120, "goal": "s"},
    {"s": 10, "c": 12, "d": 10, "h": 8, "majority": 6, "payoff": 100, "goal": "s"},
    {"s": 10, "c": 12, "d": 8, "h": 10, "majority": 6, "payoff": 100, "goal": "s"},
    {"s": 8, "c": 10, "d": 10, "h": 12, "majority": 6, "payoff": 100, "goal": "d"},
    {"s": 10, "c": 8, "d": 10, "h": 12, "majority": 6, "payoff": 100, "goal": "d"},
    {"s": 10, "c": 10, "d": 8, "h": 12, "majority": 5, "payoff": 120, "goal": "d"},
    {"s": 8, "c": 10, "d": 12, "h": 10, "majority": 6, "payoff": 100, "goal": "h"},
    {"s": 10, "c": 8, "d": 12, "h": 10, "majority": 6, "payoff": 100, "goal": "h"},
    {"s": 10, "c": 10, "d": 12, "h": 8, "majority": 5, "payoff": 120, "goal": "h"}
]

Metadata

Release files for figgiebot 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for figgiebot 1.0.1
File Size Uploaded Provenance Actions
figgiebot-1.0.1.tar.gz 5.3 kB Without provenance Details for figgiebot-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for figgiebot 1.0.1
File Interpreter ABI Platform Actions
figgiebot-1.0.1-py3-none-any.whl Python 3 none any Details for figgiebot-1.0.1-py3-none-any.whl

Total release size: 11.0 kB

Release files / figgiebot-1.0.1.tar.gz

Download URL figgiebot-1.0.1.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4f32b633a640b9970cfe963bc89ac8bcfbcd5790f3410660696fd6a9f96baff0
BLAKE2b-256 checksum
How to use checksums
cbc8e296ba8e3c5a399142d8ad7703dbf49c1a566c1b8ca3532940f33e9819e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Release files / figgiebot-1.0.1-py3-none-any.whl

Download URL figgiebot-1.0.1-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
349728917629660c941b923cd1dc6373511f9304943511357602690e8232164d
BLAKE2b-256 checksum
How to use checksums
6905856df8ee0a7dc62d0f86c7abdc396eace58822e114e931cb18f3007f037f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Security for figgiebot 1.0.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page