完整德州扑克游戏源码 /德州源码/德州俱乐部源码/德州私人局源码/ Complete Texas Hold'em source code / 完整德州撲克遊戲源码 / 德州俱乐部/德州扑克源码
专业扑克引擎 + UI + 完整规则 + 下注系统 + 牌型判断,支持二次开发 / 專業撲克引擎+UI+完整規則+下注系統+牌型判斷 / Professional engine+UI+rules+betting+hand evaluation.
# 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窗口运行!
| 模块 | 语言 | 功能 | 难度 |
|---|---|---|---|
| 引擎核心 | Python/C++ | 牌桌、发牌、结算 | ★★★ |
| 牌型判断 | C++/Python | 15种牌型排序 | ★★★★ |
| 下注系统 | JavaScript | Raise/Call/Fold | ★★ |
| UI界面 | React/HTML5 | 牌桌动画效果 | ★★☆ |
| 数据统计 | Python | 胜率、手牌历史 | ★★ |
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 # 性能测试
def evaluate_hand(hand, board):
# Royal Flush → High Card 15种排序
ranks = rank_hand(hand + board)
return {
'type': 'straight_flush',
'rank': 9,
'high_card': 'Ace'
}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): # 摊牌结算# 测试牌型判断 (核心功能)
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
| 测试项 | Python | C++ | JavaScript |
|---|---|---|---|
| 牌型判断 | 1.2ms | 0.3ms | 2.1ms |
| 单手牌局 | 45ms | 12ms | 68ms |
| 内存占用 | 35MB | 18MB | 42MB |
import { Table, evaluateHand } from './engine.js';
const game = new Table(6);
console.log(evaluateHand(holeCards, board));from engine import Table
game = Table(9)
game.play_hand()
print(game.winner)HandEvaluator eval;
HandStrength strength = eval.Evaluate(hand, board);npm run build:web
pyinstaller main.py
make && make install
docker build -t poker-engine .
✅ 新扑克变体 (Omaha/Short Deck)
✅ 性能优化
✅ UI美化
✅ 移动端适配
✅ 联网功能
✅ Docker封装
MIT License - 商用级开源 个人学习 | 商业部署 | 二次开发
⭐ 最全德州扑克源码,从入门到精通! / Complete Hold'em source, beginner to expert! / 最全德州撲克源码,從入門到精通!