SoftDes 2025

Limit Hold'em Poker Bot

Challenge our machine learning-trained poker bot and test your skills against a sophisticated opponent

♠️
♥️
♦️
♣️
Scroll to explore
PokerBot Demo Video
Watch our team explain the architecture and demonstrate the PokerBot in action

This video walkthrough explains the Model-View-Controller architecture of our PokerBot project and demonstrates the gameplay and AI decision-making process.

About the Project

Limit Hold'em Poker Clone

A student-friendly, fixed-limit Texas Hold'em sandbox built with Pygame. Our SoftDes 2025 project features a sophisticated limit hold'em poker bot trained using machine learning algorithms.

This lightweight classroom project lets you explore the core logic of fixed-limit Texas Hold'em without the complexity of a full casino client. It is intentionally streamlined for learning.

Project Goal

To create a machine learning-trained limit hold'em poker bot that provides a challenging and realistic poker experience for players, while demonstrating MVC architecture and reinforcement learning principles.

ML Training

Our bot uses Q-learning, a reinforcement learning technique, to adapt its betting strategy over many hands. The more you train it, the better it becomes at making strategic decisions.

Architecture

Built using Model-View-Controller (MVC) architecture to keep graphics, game state, and input handling cleanly separated, making the codebase easy to understand and extend.

Credits & Attribution

Our hand evaluator is based on Cactus Kev's Poker Hand Evaluator, originally written in C and reimplemented in Python for this project. The playing cards used in the game are in the public domain, and the loading screen graphics are AI-generated.

Poker Game
Features

Project Architecture

Our poker bot is built with a clean Model-View-Controller architecture that separates concerns and makes the code easy to understand and extend.

Model
  • Create & shuffle deck
  • Enforce fixed-limit betting (small bet / big bet, max three raises)
  • Track chip stacks, pot, blinds & showdown
  • Hook for reinforcement-learning agent

Key Classes: Model, QBot

View
  • Load/scale sprites
  • Render cards, chips, text overlays
  • Display game state visually
  • Provide visual feedback for player actions

Key Classes: PokerView

Controller
  • Capture mouse / keyboard events
  • Map them to model actions
  • Handle Fold / Call / Raise / Check actions
  • Manage game flow and state transitions

Key Classes: Controller

Limit Hold'em Rules

Our poker bot implements fixed-limit Texas Hold'em, which has specific betting rules that differ from the more common no-limit variant:

Betting Structure

  • Pre-flop and flop: All bets and raises are in increments of the small bet (e.g., $2 in a $2/$4 game)
  • Turn and river: All bets and raises are in increments of the big bet (e.g., $4 in a $2/$4 game)
  • Maximum of 3 raises per betting round
  • Raises must be equal to the previous bet (no variable sizing)

Game Flow

  • Small and big blinds are posted
  • Each player receives two private cards
  • First betting round (pre-flop)
  • Three community cards are dealt (the flop)
  • Second betting round
  • Fourth community card is dealt (the turn)
  • Third betting round (with big bet sizing)
  • Fifth community card is dealt (the river)
  • Final betting round (with big bet sizing)
  • Showdown if necessary
Glowing poker cards
Meet the Team

The Poker Enthusiasts

Our talented team of developers and poker enthusiasts who brought this project to life.

Troy Anderson
Lead Developer

Specialty: Game Logic & Architecture

♠️
Sreesanth Adelli
ML Specialist

Specialty: Q-Learning Implementation

♥️
Suraj Sajjala
Poker Expert

Specialty: Hand Evaluation & Game Rules

♣️
Get Started

Installation & Usage

Follow these steps to get started with our poker bot.

Installation Steps
Quick setup to get you playing in minutes

1. Clone the repository

git clone https://github.com/olincollege/PokerBot.git

2. Navigate to project directory

cd PokerBot

3. Install dependencies

pip install -r requirements.txt
Terminal
Running the Game
Follow these steps to run and train the bot

1. Generate preflop strength data

python generate_preflop_strength.py

This generates probability data for starting hands.

2. Train the ML bot (optional but recommended)

python train_ML_bot.py 1000

Replace 1000 with desired number of training hands. More training leads to better bot performance.

3. Start the game

python main.py

Running Tests:

python -m pytest tests/model_tests.py -v