Skip to main content

The Bidding Game

This is a client-side bot for the "bidding game".

Rules

This game consists of two people (or bots) that are "bidding" for a high value item, usually described as a bottle of scotch.

There are 11 "places" between each player with the bottle of scotch sitting in the middle. If a player wins a round, the bottle of scotch moves towards the player by one place. If the bottle gets all the way to the end (slot 0 or 10) then that player wins the bottle. If by the end of 10 rounds neither player wins, the game is considered a draw.

To win a round, each player must secretly bid some amount of money. The player with the biggest bid wins that round, and the bottle of scotch moves one position towards them. Each player starts with $100, and must bid in $1 increments. The player who wins the round has their bid deducted from their total, and the player who lost keeps their bid.

In the case of both bids being equal, the player with "draw advantage" wins the round. "Draw advantage" starts with player A, and every time there is a draw, "draw advantage" is switched to the other player.

Finally, you must bid at least $1, unless you're out of money in which case you may bid $0. Make sure you include this as part of your bot or your bids will be invalid and the game will be abandoned.

Making A Bot

The following is necessary to make a bot:

  1. Install this library. This is easily done by running: pip3 install bidbot
  2. Extend the BidBot object.
  3. Connect to a server.

Example bot:

The following is full example of a bot. Note that the only thing a play can really do is pick a bid, you only need to override one object. The following is a bot that randomly picks an amount to play.

from bidbot.BidBot import BidBot
from bidbot.GameState import GameState
from bidbot.BotClient import connect
import random

class RandomBot(BidBot):

    def get_bid(self, game_state: GameState):
        if game_state.my_money <= 1:
            return game_state.my_money
        else:
            return random.randrange(1, game_state.my_money)


def main():

    username = "your_username"
    bot = RandomBot(username)
    host = "your_sever.hostname.com"
    port = 8080

    connect(host, port, username, bot)

if __name__ == "__main__":
    main()

GameState

There's lots of information that can be used to assist you in picking a bid. The following fields are some useful ones:

  • game_state.self.opponent_username - The opponents username.
  • game_state.self.player_identifier - Determines if we are GameState.PLAYER_A or GameState.PLAYER_B
  • game_state.opponent_money - The amount of money the opponent has left.
  • game_state.my_money - The amount of money your bot has left.
  • game_state.bottle_position - The current bottle position.
  • game_state.opponents_bids - A list of the bids the opponent has made up until now.
  • game_state.my_bids - A list of bids that your bot has made up until now.
  • game_state.start_money - The amount of money the game was started with. Typically, this is $100.
  • game_state.rounds_won - The number of rounds that have been won.
  • game_state.rounds_lost - The number of rounds that have been lost.

Metadata

Release files for bidbot 0.1.4

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

Source distribution (sdist)

Source distribution for bidbot 0.1.4
File Size Uploaded
bidbot-0.1.4.tar.gz 10.6 kB Details

Built distribution (wheel)

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

Total release size: 23.4 kB

Release files / bidbot-0.1.4.tar.gz

Download URL bidbot-0.1.4.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
63c3518164fb2255df895e18138caa0af06d5180d75e747bd3ec2ee4ed81d4b0
BLAKE2b-256 checksum
How to use checksums
7c087ba00dbc85a15efe4577a1fa970f032a0c286f35a9e71355573b3f25855a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / bidbot-0.1.4-py3-none-any.whl

Download URL bidbot-0.1.4-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2c42fcce55a4c95813ba9f0125189995336028388932be2dd70326a75341e4a9
BLAKE2b-256 checksum
How to use checksums
8910094698bf475778240c2f6cfb5bb5550d80499ed50a1b1c03245a306205f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

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