【明日方舟】抽卡模拟程序
import randomp6 = 2#初始抽到六星概率
p5 = 10#初始抽到五星以上概率
p4 = 60#初始抽到四星以上概率
n = 0#未抽到六星次数初始为0
q = 0#抽卡次数初始为0
p = 0#抽卡次数(不重置)
def single(t):
global p6,p5,p4
s6 = ['推进之王★★★★★★','陈★★★★★★','赫拉格★★★★★★','煌★★★★★★','斯卡蒂★★★★★★','银灰★★★★★★','黑★★★★★★','能天使★★★★★★','塞雷娅★★★★★★','星熊★★★★★★','闪灵★★★★★★','夜莺★★★★★★','安洁莉娜★★★★★★','麦哲伦★★★★★★','艾雅法拉★★★★★★','莫斯提马★★★★★★','伊芙利特★★★★★★','阿★★★★★★']
s5 = ['德克萨斯★★★★★','凛冬★★★★★','苇草★★★★★','布洛卡★★★★★','芙兰卡★★★★★','拉普兰德★★★★★','诗怀雅★★★★★','星极★★★★★','幽灵鲨★★★★★','白金★★★★★','灰喉★★★★★','蓝毒★★★★★','普罗旺斯★★★★★','守林人★★★★★','送葬人★★★★★','陨星★★★★★','吽★★★★★','可颂★★★★★','雷蛇★★★★★','临光★★★★★','白面鸮★★★★★','赫默★★★★★','华法琳★★★★★','初雪★★★★★','格劳克斯★★★★★','空★★★★★','梅尔★★★★★','真理★★★★★','天火★★★★★','夜魔★★★★★','红★★★★★','槐琥★★★★★','狮蝎★★★★★','食铁兽★★★★★','崖心★★★★★']
s4 = ['红豆★★★★','清道夫★★★★','桃金娘★★★★','缠丸★★★★','杜宾★★★★','猎蜂★★★★','慕斯★★★★','霜叶★★★★','安比尔★★★★','白雪★★★★','红云★★★★','杰西卡★★★★','流星★★★★','梅★★★★','古米★★★★','角峰★★★★','蛇屠箱★★★★','调香师★★★★','末药★★★★','苏苏洛★★★★','地灵★★★★','深海色★★★★','格雷伊★★★★','夜烟★★★★','远山★★★★','阿消★★★★','暗锁★★★★','砾★★★★']
s3 = ['芬★★★','翎羽★★★','香草★★★','玫兰莎★★★','泡普卡★★★','月见夜★★★','克洛丝★★★','空爆★★★','斑点★★★','卡缇★★★','米格鲁★★★','安塞尔★★★','芙蓉★★★','梓兰★★★','史都华德★★★','炎熔★★★']
if t == '1':
up6 = ['赫拉格★★★★★★','闪灵★★★★★★']
up5 = ['凛冬★★★★★','狮蝎★★★★★','华法琳★★★★★']
elif t == '2':
up6 = ['推进之王★★★★★★','陈★★★★★★']
up5 = ['德克萨斯★★★★★','真理★★★★★','凛冬★★★★★']
elif t == '3':
up6 = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
up5 = ['夜魔★★★★★','赫默★★★★★','诗怀雅★★★★★']
else:
up6 = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
up5 = ['夜魔★★★★★','赫默★★★★★','诗怀雅★★★★★']
i1 = random.uniform(0,100)#干员寻访开始,抽取随机数
i2 = random.uniform(0,20)#随机选择是否抽中up干员
if i1 < p6: #抽中六星干员
if i2 < 10:#抽中六星up
c = random.randint(0,1)#随机抽取两个六星干员中的一个
result = up6
if i2 >= 10:
c = random.randint(0,15)#随机抽取剩余十六个六星干员
n6 = s6
n6.remove(up6)
n6.remove(up6)#得到剩余十六个六星干员列表
result = n6
if i1 > p6 and i1 <= p5:#抽中五星干员
if i2 < 10:#抽中五星up
c = random.randint(0,2)#随机抽取三个五星干员中的一个
result = up5
if i2 >= 10:
c = random.randint(0,31)#随机抽取剩余的五星干员
n5 = s5
n5.remove(up5)
n5.remove(up5)
n5.remove(up5)
result = n5
if i1 > p5 and i1 <= p4:#抽中四星干员
c = random.randint(0,27)
result = s4
if i1 > p4 and i1 < 100:#抽中三星干员
c = random.randint(0,15)
result = s3
return result
def draw(t,i):
global p6,p5,p4,n,q,p
q = 0
cal6 = 0
cal5 = 0
calup1 = 0
calup2 = 0
if t == '1':
checkup = ['赫拉格★★★★★★','闪灵★★★★★★']
elif t == '2':
checkup = ['推进之王★★★★★★','陈★★★★★★']
elif t == '3':
checkup = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
else:
print('输入错误,将选择默认最新卡池:艾雅法拉、斯卡蒂卡池')
checkup = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
while q < i:
result = single(t)
print(result)
q += 1
p += 1
check6 = ['推进之王★★★★★★','陈★★★★★★','赫拉格★★★★★★','煌★★★★★★','斯卡蒂★★★★★★','银灰★★★★★★','黑★★★★★★','能天使★★★★★★','塞雷娅★★★★★★','星熊★★★★★★','闪灵★★★★★★','夜莺★★★★★★','安洁莉娜★★★★★★','麦哲伦★★★★★★','艾雅法拉★★★★★★','莫斯提马★★★★★★','伊芙利特★★★★★★','阿★★★★★★']
check5 = ['德克萨斯★★★★★','凛冬★★★★★','苇草★★★★★','布洛卡★★★★★','芙兰卡★★★★★','拉普兰德★★★★★','诗怀雅★★★★★','星极★★★★★','幽灵鲨★★★★★','白金★★★★★','灰喉★★★★★','蓝毒★★★★★','普罗旺斯★★★★★','守林人★★★★★','送葬人★★★★★','陨星★★★★★','吽★★★★★','可颂★★★★★','雷蛇★★★★★','临光★★★★★','白面鸮★★★★★','赫默★★★★★','华法琳★★★★★','初雪★★★★★','格劳克斯★★★★★','空★★★★★','梅尔★★★★★','真理★★★★★','天火★★★★★','夜魔★★★★★','红★★★★★','槐琥★★★★★','狮蝎★★★★★','食铁兽★★★★★','崖心★★★★★']
if result not in check6:#未获得六星干员
n += 1#次数累积
if result in check6:#抽到六星干员
n = 0#次数重置
p6 = 2#重置抽到六星概率
p5 = 10#重置抽到五星以上概率
p4 = 60#重置抽到四星以上概率
cal6 += 1
if n >= 50 and n < 100:#概率变动
p4 = p6 + 2 + (p4-p6-2)*(p4-p6)/(100-p6)
p5 = p6 + 2 + (p5-p6-2)*(p4-p6)/(100-p6)
p6 += 2
if result in check5:
cal5 += 1
if result == checkup:
calup1 += 1
if result == checkup:
calup2 += 1
print('本次共寻访' + str(q) +'次,未获得六星' + str(n) + '次,消耗合成玉' + str(q*600) + ',消耗源石' + str(q*10/3) + '颗')
print('共获得六星干员' + str(cal6) + '个,五星干员' + str(cal5) + '个,六星up' + checkup + str(calup1) + '个,六星up' + checkup + str(calup2) + '个')
print('获得六星概率为:'+str(cal6/q)+'\n获得五星以上概率为:'+str(cal5/q))
print('总计共寻访' + str(p) +'次,消耗合成玉' + str(p*600) + ',消耗源石' + str(p*10/3) + '颗')
title0 = '明日方舟干员寻访模拟程序'
title1 = '卡池选择'
title = title0.center(100)
subtitle = title1.center(100)
print(title)
print(subtitle)
print('(本程序支持【常驻标准寻访】)')
t = str(input(' 1.【赫拉格,闪灵】【凛冬,狮蝎,华法琳】\n 2.【推进之王,陈】【德克萨斯,真理,凛冬】\n 3.【艾雅法拉,斯卡蒂】【夜魔,赫默,诗怀雅】\n 选择卡池:'))#卡池选择
i = int(input('请输入寻访次数:'))
draw(t,i)
while 1:
v = input('下一步:\n1.继续寻访\n2.退出程序\n输入:')
if v == '1':
t = str(input(' 1.【赫拉格,闪灵】【凛冬,狮蝎,华法琳】\n 2.【推进之王,陈】【德克萨斯,真理,凛冬】\n 3.【艾雅法拉,斯卡蒂】【夜魔,赫默,诗怀雅】\n 选择卡池:'))#卡池选择
i = int(input('请输入寻访次数:'))
draw(t,i)
elif v == '2':
break
else:
print('请重新输入:\n1.继续寻访\n2.退出程序\n输入:')
import random
import easygui as g
p6 = 2#初始抽到六星概率
p5 = 10#初始抽到五星以上概率
p4 = 60#初始抽到四星以上概率
n = 0#未抽到六星次数初始为0
q = 0#抽卡次数初始为0
p = 0#抽卡次数(不重置)
result0 = ''
def single(t):
global p6,p5,p4
s6 = ['推进之王★★★★★★','陈★★★★★★','赫拉格★★★★★★','煌★★★★★★','斯卡蒂★★★★★★','银灰★★★★★★','黑★★★★★★','能天使★★★★★★','塞雷娅★★★★★★','星熊★★★★★★','闪灵★★★★★★','夜莺★★★★★★','安洁莉娜★★★★★★','麦哲伦★★★★★★','艾雅法拉★★★★★★','莫斯提马★★★★★★','伊芙利特★★★★★★','阿★★★★★★']
s5 = ['德克萨斯★★★★★','凛冬★★★★★','苇草★★★★★','布洛卡★★★★★','芙兰卡★★★★★','拉普兰德★★★★★','诗怀雅★★★★★','星极★★★★★','幽灵鲨★★★★★','白金★★★★★','灰喉★★★★★','蓝毒★★★★★','普罗旺斯★★★★★','守林人★★★★★','送葬人★★★★★','陨星★★★★★','吽★★★★★','可颂★★★★★','雷蛇★★★★★','临光★★★★★','白面鸮★★★★★','赫默★★★★★','华法琳★★★★★','初雪★★★★★','格劳克斯★★★★★','空★★★★★','梅尔★★★★★','真理★★★★★','天火★★★★★','夜魔★★★★★','红★★★★★','槐琥★★★★★','狮蝎★★★★★','食铁兽★★★★★','崖心★★★★★']
s4 = ['红豆★★★★','清道夫★★★★','桃金娘★★★★','缠丸★★★★','杜宾★★★★','猎蜂★★★★','慕斯★★★★','霜叶★★★★','安比尔★★★★','白雪★★★★','红云★★★★','杰西卡★★★★','流星★★★★','梅★★★★','古米★★★★','角峰★★★★','蛇屠箱★★★★','调香师★★★★','末药★★★★','苏苏洛★★★★','地灵★★★★','深海色★★★★','格雷伊★★★★','夜烟★★★★','远山★★★★','阿消★★★★','暗锁★★★★','砾★★★★']
s3 = ['芬★★★','翎羽★★★','香草★★★','玫兰莎★★★','泡普卡★★★','月见夜★★★','克洛丝★★★','空爆★★★','斑点★★★','卡缇★★★','米格鲁★★★','安塞尔★★★','芙蓉★★★','梓兰★★★','史都华德★★★','炎熔★★★']
if t == '1':
up6 = ['赫拉格★★★★★★','闪灵★★★★★★']
up5 = ['凛冬★★★★★','狮蝎★★★★★','华法琳★★★★★']
elif t == '2':
up6 = ['推进之王★★★★★★','陈★★★★★★']
up5 = ['德克萨斯★★★★★','真理★★★★★','凛冬★★★★★']
elif t == '3':
up6 = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
up5 = ['夜魔★★★★★','赫默★★★★★','诗怀雅★★★★★']
else:
up6 = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
up5 = ['夜魔★★★★★','赫默★★★★★','诗怀雅★★★★★']
i1 = random.uniform(0,100)#干员寻访开始,抽取随机数
i2 = random.uniform(0,20)#随机选择是否抽中up干员
if i1 < p6: #抽中六星干员
if i2 < 10:#抽中六星up
c = random.randint(0,1)#随机抽取两个六星干员中的一个
result = up6
if i2 >= 10:
c = random.randint(0,15)#随机抽取剩余十六个六星干员
n6 = s6
n6.remove(up6)
n6.remove(up6)#得到剩余十六个六星干员列表
result = n6
if i1 > p6 and i1 <= p5:#抽中五星干员
if i2 < 10:#抽中五星up
c = random.randint(0,2)#随机抽取三个五星干员中的一个
result = up5
if i2 >= 10:
c = random.randint(0,31)#随机抽取剩余的五星干员
n5 = s5
n5.remove(up5)
n5.remove(up5)
n5.remove(up5)
result = n5
if i1 > p5 and i1 <= p4:#抽中四星干员
c = random.randint(0,27)
result = s4
if i1 > p4 and i1 < 100:#抽中三星干员
c = random.randint(0,15)
result = s3
return result
def draw(t,i):
global p6,p5,p4,n,q,p,result0
q = 0
cal6 = 0
cal5 = 0
calup1 = 0
calup2 = 0
if t == '1':
checkup = ['赫拉格★★★★★★','闪灵★★★★★★']
elif t == '2':
checkup = ['推进之王★★★★★★','陈★★★★★★']
elif t == '3':
checkup = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
else:
g.msgbox('输入错误,将选择默认最新卡池:艾雅法拉、斯卡蒂卡池')
checkup = ['艾雅法拉★★★★★★','斯卡蒂★★★★★★']
while q < i:
result = single(t)
result0 = result0 + '\n' + result
q += 1
p += 1
check6 = ['推进之王★★★★★★','陈★★★★★★','赫拉格★★★★★★','煌★★★★★★','斯卡蒂★★★★★★','银灰★★★★★★','黑★★★★★★','能天使★★★★★★','塞雷娅★★★★★★','星熊★★★★★★','闪灵★★★★★★','夜莺★★★★★★','安洁莉娜★★★★★★','麦哲伦★★★★★★','艾雅法拉★★★★★★','莫斯提马★★★★★★','伊芙利特★★★★★★','阿★★★★★★']
check5 = ['德克萨斯★★★★★','凛冬★★★★★','苇草★★★★★','布洛卡★★★★★','芙兰卡★★★★★','拉普兰德★★★★★','诗怀雅★★★★★','星极★★★★★','幽灵鲨★★★★★','白金★★★★★','灰喉★★★★★','蓝毒★★★★★','普罗旺斯★★★★★','守林人★★★★★','送葬人★★★★★','陨星★★★★★','吽★★★★★','可颂★★★★★','雷蛇★★★★★','临光★★★★★','白面鸮★★★★★','赫默★★★★★','华法琳★★★★★','初雪★★★★★','格劳克斯★★★★★','空★★★★★','梅尔★★★★★','真理★★★★★','天火★★★★★','夜魔★★★★★','红★★★★★','槐琥★★★★★','狮蝎★★★★★','食铁兽★★★★★','崖心★★★★★']
if result not in check6:#未获得六星干员
n += 1#次数累积
if result in check6:#抽到六星干员
n = 0#次数重置
p6 = 2#重置抽到六星概率
p5 = 10#重置抽到五星以上概率
p4 = 60#重置抽到四星以上概率
cal6 += 1
if n >= 50 and n < 100:#概率变动
p4 = p6 + 2 + (p4-p6-2)*(p4-p6)/(100-p6)
p5 = p6 + 2 + (p5-p6-2)*(p4-p6)/(100-p6)
p6 += 2
if result in check5:
cal5 += 1
if result == checkup:
calup1 += 1
if result == checkup:
calup2 += 1
g.textbox(msg = '您的抽卡结果如下,快看看出货了没有吧!',
title = '抽卡结果',text = result0
+'\n本次共寻访' + str(q) +'次,未获得六星' + str(n)
+ '次,消耗合成玉' + str(q*600) +
',消耗源石' + str(q*10/3) + '颗\n'
'共获得六星干员' + str(cal6)
+ '个,五星干员' + str(cal5)
+ '个,六星up' + checkup
+ str(calup1) + '个,六星up'
+ checkup + str(calup2) + '个\n'
'获得六星概率为:'+str(cal6/q)+'\n获得五星以上概率为:'+ str(cal5/q)+
'\n总计共寻访' + str(p) +'次,消耗合成玉' + str(p*600)+
',消耗源石' + str(p*10/3) + '颗')
title0 = '明日方舟干员寻访模拟程序'
title1 = '卡池选择'
title = title0.center(20)
subtitle = title1.center(20)
print('Loading......')
g.msgbox(msg ='明日方舟干员寻访模拟程序\n本程序支持【标准寻访】',ok_button = '开始寻访')
def choose():
choices = ['1.【赫拉格,闪灵】【凛冬,狮蝎,华法琳】',
'2.【推进之王,陈】【德克萨斯,真理,凛冬】',
'3.【艾雅法拉,斯卡蒂】【夜魔,赫默,诗怀雅】']
t = g.choicebox('请选择卡池:',choices = choices)
t = t
int(t)
return t
t = choose()
i = int(g.enterbox(msg = '请输入抽卡次数:'))
draw(t,i)
while 1:
v = g.ccbox(msg = '下一步:\n1.继续寻访\n2.退出程序\n输入:',title = 'NEXT',
choices = ('1.继续寻访','2.退出程序'),
)
if v == True:
t = choose()
i = int(g.enterbox(msg = '请输入抽卡次数:'))
draw(t,i)
elif v == False:
break
这是用easyGUI的版本 白咕咕 发表于 2020-2-15 13:55
这是用easyGUI的版本
不错,继续加油{:10_256:} qiuyouzhi 发表于 2020-2-15 14:05
不错,继续加油
谢谢 要是有图就牛逼了
页:
[1]