Skip to content

darcmon/poker-be

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run Locally

  1. Create and activate a new virtual environment.

    $ python3 -m venv .venv
    $ . .venv/bin/activate
  2. Install dependencies.

    $ pip install -r requirements.txt
  3. Launch the development server.

    $ uvicorn main:app --reload

Example Game State

def generate_deck_of_cards():
    values = list(range(1, 14))
    suits = ["D", "C", "H", "S"]
    cards = list(itertools.product(values, suits))
    random.shuffle(cards)
    return cards

state = {
    "cards": generate_deck_of_cards(),
    "players": [
        {
            "first_name": "Shad",
            "last_name": "Sharma",
            "email": "shadanan@gmail.com",
            "pool": 500,
            "state": 0,  # 0: fold, 1: call, 2: raise
            "bet": 200,
        },
        {
            "first_name": "Sachie",
            "last_name": "Sharma",
            "email": "sachie@gmail.com",
            "pool": 50,
            "state": 1,  # 0: fold, 1: call, 2: raise
            "bet": 50,
        },
        {
            "first_name": "Richard",
            "last_name": "Ngo",
            "email": "richard1ngo@gmail.com",
            "pool": 500,
            "state": 2,  # 0: fold, 1: call, 2: raise
            "bet": 200,
        },
        {
            "first_name": "Niwako",
            "last_name": "Sugimura",
            "email": "niwako@gmail.com",
            "pool": 500,
            "state": 1,  # 0: fold, 1: call, 2: raise
            "bet": 6,
        },
    ],
    "dealer": 0,  ## Index into players
    "bet_size": 2,
    "turn": 3,  # 0: ante, 1: flop, 2: turn, 3: river
    "round": 0,
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages