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) Coming soon...

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.0.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.0.0-py3-none-any.whl (43.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fairpoker-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 cb551d116e0387a346c2b4be5f231c4e4f8ac24cffe58498f3a687e7dc63525b
MD5 483e82f4bee81faa312c717bbc0c1c60
BLAKE2b-256 b81b3005675ce90e64ae184ba39c159fcc039ac6a2b4cb3bce608bc75e29d0a2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fairpoker-1.0.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe2e53f122b18ecea880a1f8e885558f2b9a805a3feb41247fdded267d810f8
MD5 2320d114f721a99832d99ffc6f1c4202
BLAKE2b-256 a418375b2d56fb9a01407506fbfeca1e1faefa4fd1e064661c1fff8ca0d4758e

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