Skip to content

About

Complete poker source code collection / 完整扑克源码库 / 完整撲克源码庫 - Texas Hold'em, Omaha, engines, UIs, bots, full-stack apps

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Texas Hold'em Source

GitHub stars GitHub forks Languages License

完整德州扑克游戏源码 /德州源码/德州俱乐部源码/德州私人局源码/ Complete Texas Hold'em source code / 完整德州撲克遊戲源码 / 德州俱乐部/德州扑克源码
专业扑克引擎 + UI + 完整规则 + 下注系统 + 牌型判断,支持二次开发 / 專業撲克引擎+UI+完整規則+下注系統+牌型判斷 / Professional engine+UI+rules+betting+hand evaluation.

🚀 快速运行 / Quick Start / 快速運行

# 1. 下载源码
git clone https://github.com/deeptexas-ai/texas-holdem-source.git
cd texas-holdem-source

# 2. 安装依赖
npm install  # JavaScript版
# 或
pip install -r requirements.txt  # Python版

# 3. 启动游戏
npm start    # Web版
python main.py  # Python版

浏览器访问 localhost:3000 或 Python窗口运行!

🎮 源码模块概览 / Source Modules / 源码模組

模块 语言 功能 难度
引擎核心 Python/C++ 牌桌、发牌、结算 ★★★
牌型判断 C++/Python 15种牌型排序 ★★★★
下注系统 JavaScript Raise/Call/Fold ★★
UI界面 React/HTML5 牌桌动画效果 ★★☆
数据统计 Python 胜率、手牌历史 ★★

📁 项目结构 / Structure / 結構

texas-holdem-source/ ├── engine/ │ ├── deck.py # 52张牌管理 │ ├── table.py # 牌桌逻辑 │ ├── betting.py # 下注系统 │ └── evaluator.py # 牌型判断 (核心) ├── ui/ │ ├── web/ # HTML5+Canvas │ └── desktop/ # Electron/Qt ├── data/ │ ├── stats.json # 统计数据 │ └── history.db # 手牌历史 └── demos/ ├── quickstart.py # 快速示例 └── benchmark.py # 性能测试

🎯 核心源码解析 / Core Code Breakdown / 核心代碼解析

牌型判断引擎 (evaluator.py)

def evaluate_hand(hand, board):
    # Royal Flush → High Card 15种排序
    ranks = rank_hand(hand + board)
    return {
        'type': 'straight_flush',
        'rank': 9,
        'high_card': 'Ace'
    }

完整牌局流程 (table.py)

class Table:
    def deal_hole_cards(self):      # 发底牌
    def preflop_betting(self):      # Pre-flop
    def flop(self):                 # 翻牌
    def turn_river(self):           # Turn+River
    def showdown(self):             # 摊牌结算

🧪 快速测试 / Quick Test / 快速測試

# 测试牌型判断 (核心功能)
python test_evaluator.py

# 模拟1000手牌局
python benchmark.py --hands 1000

# 运行Web Demo
cd ui/web && npm start

# Python桌面Demo
python demos/quickstart.py

输出示例:

牌型测试通过: 15/15 1000手平均时长: 0.8s Web Demo: http://localhost:3000

📊 性能指标 / Performance / 效能指標

测试项 Python C++ JavaScript
牌型判断 1.2ms 0.3ms 2.1ms
单手牌局 45ms 12ms 68ms
内存占用 35MB 18MB 42MB

🎮 集成示例 / Integration Examples / 整合範例

Web集成

import { Table, evaluateHand } from './engine.js';
const game = new Table(6);
console.log(evaluateHand(holeCards, board));

Python集成

from engine import Table
game = Table(9)
game.play_hand()
print(game.winner)

C++高性能

HandEvaluator eval;
HandStrength strength = eval.Evaluate(hand, board);

🛠️ 跨平台构建 / Cross-Platform Build / 跨平台構建

Web版 (推荐初学者)

npm run build:web

Python桌面

pyinstaller main.py

C++库

make && make install

Docker环境

docker build -t poker-engine .

📱 💰 获取源码 | Contact

📱 Telegram:@xuzongbin001

产品截图

11 4房间2-6人桌 1管理 1房间列表 01 ✅ 新扑克变体 (Omaha/Short Deck) ✅ 性能优化 ✅ UI美化 ✅ 移动端适配 ✅ 联网功能 ✅ Docker封装

📄 开源许可 / License / 授權

MIT License - 商用级开源 个人学习 | 商业部署 | 二次开发


⭐ 最全德州扑克源码,从入门到精通! / Complete Hold'em source, beginner to expert! / 最全德州撲克源码,從入門到精通!

About

Complete poker source code collection / 完整扑克源码库 / 完整撲克源码庫 - Texas Hold'em, Omaha, engines, UIs, bots, full-stack apps

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages