资源简介
poker.zip

代码片段和文件信息
pai = [(20 ‘♠8‘) (20 ‘♠9‘)(28 ‘♣10‘) (48 ‘♣J‘) (40 ‘♣Q‘) (18 ‘♣K‘) (28 ‘♣A‘)]
#牌号值进行转换
def zhuanhuan(hand):
global shuzi
global huase
shuzi = []
huase = []
for i in hand:
shuzi.append((i[0]) % 13)
huase.append((i[0]) // 13)
#print(huaseshuzi)
return shuzi huase
#定义五项的组合
def combin(nums):
from itertools import combinations
result = []
for i in combinations(nums5):
result.append(list(i))
return result
#判断是否对子
def kind(npai):
dui = []
zhuanhuan(pai)
for i in shuzi:
shu = shuzi.count(i)
if shu == n:
if i in dui:
continue
dui.append(i)
return dui
#判断牌型级别
def shunzi(pai):
global jibie
jibie = 0
zhuanhuan(pai)
‘‘‘
#判断是否是高牌
if max(shuzi) == 13 and len(set(shuzi)) == 5:
jibie =jibie + 10**1
‘‘‘
#判断是否皇家同花顺
if max(shuzi)- min(shuzi) == 4 and len(set(shuzi)) == 5 and len(set(huase)) == 1 and max(shuzi) == 12:
jibie = 900
return jibie
#判断是否同花顺
elif max(shuzi)- min(shuzi) == 4 and len(set(shuzi)) == 5 and len(set(huase)) == 1 and max(shuzi) != 13:
jibie = 800 + max(shuzi)
return jibie
#判断是否四条
elif len(kind(4 pai)) == 1:
for i in shuzi:
if i not in kind(4 pai):
ti = i
jibie = 700 + max(kind(4 pai)) + ti * 0.01
return jibie
#判断是否葫芦
elif len(kind(3 pai)) == 1 and len(kind(2 pai)) == 1:
jibie = 600 + max(kind(3 pai)) + max(kind(2 pai)) * 0.01
return jibie
#判断是否同花
elif len(set(huase)) == 1:
lin = list(shuzi)
lin.sort(reverse=True)
jibie = 500 + lin[0] + lin[1] * 0.01 + lin[2] * 0.0001 + lin[3] * 0.000001 + lin[4] * 0.00000001
return jibie
#判断是否顺子
elif max(shuzi)- min(shuzi) == 4 and len(set(shuzi)) == 5 and max(shuzi) != 13:
jibie = 400 + max(shuzi)
return jibie
#判断是否三条
elif len(kind(3 pai)) == 1:
lin = list(shuzi)
lin.sort(reverse=True)
ti = []
for i in shuzi:
if i not in kind(4 pai):
ti.append(i)
jibie = 300+ max(kind(3 pai)) + ti[0] * 0.01 + ti[1] * 0.0001
return jibie
#判断是否两对
elif len(kind(2 pai)) == 2:
for i in shuzi:
if i != max(kind(2 pai)) and i != min(kind(2 pai)):
ti = i
jibie = 200 + max(kind(2 pai)) + min(kind(2 pai)) * 0.01 + ti * 0.0001
return jibie
# 判断是否对子
elif len(kind(2 pai)) == 1:
lin = list(shuzi)
lin.sort(reverse=True)
ti = []
for i in shuzi:
if i != max(kind(2 pai)):
ti.append(i)
jibie = 100+ max(kind(2 pai)) + ti[0] * 0.01 + ti[1] * 0.0001 + ti[2] * 0.000001
return jibie
# 判断是否普
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-05-08 20:41 poker \__pycache__\
文件 3788 2019-05-07 21:05 poker \__pycache__\paixing.cpython-37.pyc
文件 6052 2019-05-05 00:06 poker \paixing.py
文件 2849 2019-05-06 19:01 poker \poker.py
文件 4681 2019-05-03 00:55 poker \tongji.py
文件 47104 2019-05-06 19:36 poker \关系图.vsd
文件 51462 2019-04-29 20:22 poker \牌型.jpg
文件 9615 2019-05-08 22:53 poker \权值思路.xlsx
- 上一篇:CAD插件文字刷
- 下一篇:差分进化算法源代码DE
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论