Files
poker_task1/task4_readme.md
2025-09-24 16:54:52 +08:00

61 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Task 4
## 项目概述
从Task1标准扑克扩展到短牌扑克
## 支持的手牌类型
1. **皇家同花顺** (Royal Flush) - A♠K♠Q♠J♠T♠
2. **同花顺** (Straight Flush) - 连续的五张同花色牌
3. **四条** (Four of a Kind) - 四张相同点数的牌
4. **同花** (Flush) - 五张同花色的牌
5. **满堂红** (Full House) - 三条加一对
6. **顺子** (Straight) - 五张连续点数的牌包括A-2-3-4-5轮子
7. **三条** (Three of a Kind) - 三张相同点数的牌
8. **两对** (Two Pair) - 两个对子
9. **一对** (One Pair) - 一个对子
10. **高牌** (High Card) - 没有组合的单张高牌
### 环境要求
**牌组特性**
- 移除2、3、4、5保留6-A36张牌
- 支持A-6-7-8-9特殊顺子
**手牌排名调整**
```
短牌vs标准扑克的关键差异
- Flush (同花) > Full House (满堂红)
- 其他排名保持一致
```
**可能的顺子组合**
1. A-6-7-8-9
2. 6-7-8-9-T
3. 7-8-9-T-J
4. 8-9-T-J-Q
5. 9-T-J-Q-K
6. T-J-Q-K-A
### 测试
**单元测试**
- Card类创建、解析、验证、比较
- HandEvaluator各种手牌类型识别
- HandRanking排名比较和字符串表示
**关键验证用例**
```bash
# 标准扑克 - Royal Flush
python main.py "AsKs QsJsTsAdAc"
# 输出: Royal Flush
# 短牌扑克 - 关键规则验证
python shortdeck_main.py "AsKs QsJs9s" # Flush
python shortdeck_main.py "AsAh AcKsKh" # Full House
# 短牌扑克
python shortdeck_main.py "As9h 8d7c6s9dKs"
```