资源简介
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
相关资源
- beta_build.dll
- 10493925-1534760938165.zip
- Main.unity
- buckboost.slx
- 零基础学习QTP自动化测试视频教程.
- sms1.2.rar
- 内含地址.txt
- 安养_易模块反编译工具[支持带密码
- KUKA和康耐视相机TCPIP通讯.pptx
- ArcGIS研习班.txt
- 停车场项目.sln
- 自己推过的之前方程.txt
- OpenGL文件.zip
- Transformation.rar
- 3dsmax2018keygen64.rar
- CognexVisionPro初级视频教程.txt
- ysfGame.zip
- 脑电信号处理.rar
- 普中PZ6806L开发板光盘资料结构必看
- 机械设计手册PDF和软件版.txt
- KT国际彩2018.7修复完整无错.rar
- ai智能伪原创.zip
- 数据结构农夫过河.rar
- 关于nfa确定化.zip
- B.pdf
- 百度网盘信息.txt
- JQ8900串口.zip
- 7E种子号.txt
- 链接-提取码.txt
- 北理工2018最优化方法大作业90.zip
评论
共有 条评论