Skip to main content

Terminal-based Texas Hold'em Poker game with AI opponents

Project description

Poker

A terminal-based Texas Hold'em Poker game with AI opponents.

Poker Demo

Features

  • 1-3 AI Opponents - Play heads-up or at a full 4-handed table
  • 3 Difficulty Levels
    • Easy - Loose passive "fish" that calls too much
    • Medium - Tight aggressive "shark" with solid fundamentals
    • Hard - Near-GTO play with opponent exploitation
  • Full Poker Experience
    • Pre-flop, Flop, Turn, River betting rounds
    • Proper blind structure and dealer rotation
    • All-in situations and side pots
  • Real-time Odds - See your win probability and hand odds
  • Hand Rankings Reference - Built-in guide for beginners
  • Beautiful Terminal UI - Unicode cards with color suits

Installation

Homebrew (macOS)

brew tap tvyomkesh/poker
brew install poker

pip (All platforms)

pip install fairpoker

From source

git clone https://github.com/tvyomkesh/poker.git
cd poker
pip install -e .

Usage

# If installed via brew or pip:
poker

# Or:
fairpoker

# From source:
python main.py

Controls

Key Action
C Check (when no bet) / Call (when facing bet)
R Raise / Bet
F Fold
Q Quit
N Next hand (after showdown)

Requirements

  • Terminal Size: 140 x 40 minimum
  • Python: 3.8 or higher
  • Platform: macOS, Linux, Windows (with windows-curses)

How to Play

  1. Select difficulty - Choose Easy, Medium, or Hard opponents
  2. Select number of bots - Play against 1, 2, or 3 AI players
  3. Play poker! - Standard Texas Hold'em rules apply:
    • Each player gets 2 hole cards
    • 5 community cards are dealt (3 on flop, 1 on turn, 1 on river)
    • Best 5-card hand wins
    • Bet, raise, call, or fold your way to victory!

Hand Rankings (Best to Worst)

  1. Royal Flush - A K Q J 10 same suit
  2. Straight Flush - 5 consecutive, same suit
  3. Four of a Kind - 4 cards same rank
  4. Full House - 3 of a kind + pair
  5. Flush - 5 cards same suit
  6. Straight - 5 consecutive cards
  7. Three of a Kind - 3 cards same rank
  8. Two Pair - 2 different pairs
  9. One Pair - 2 cards same rank
  10. High Card - Highest card wins

License

MIT License - see LICENSE for details.

Author

Vyomkesh Tripathi


Made with Python and curses. No actual gambling involved!

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

fairpoker-1.2.0.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

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

fairpoker-1.2.0-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

Details for the file fairpoker-1.2.0.tar.gz.

File metadata

  • Download URL: fairpoker-1.2.0.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fairpoker-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f0bf9deb5abef8939911553598ade609f63b8ba1c1e7471d28904548eb187c51
MD5 85dc8624ae2ef752154b8406723e3e0c
BLAKE2b-256 f5c69d7a81432002c9fd765b2a382007e1db5724f8ab5a08faecf2deca33d49f

See more details on using hashes here.

File details

Details for the file fairpoker-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: fairpoker-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 43.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fairpoker-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 597e1dcb3f7da035e3bf87e64e3588d9e9d34531ebd8f91443f04913d9e33495
MD5 61085e59cbd6cccaab1010d6a62028c4
BLAKE2b-256 d06993d3868a53062dff08bd425aac2c4e98eaab8944432fe5b9b913d88cc223

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