import random
def main():
shw = True
a = [0, 0, 0, 0, 0, 0]
l = [0, 0, 0, 0, 0, 0]
drw = 0
p = []
selsp = 0
delsp = 0
for i in range(6):
a[i] = random.randint(1, 33)
while len(a) != len(set(a)):
for i in range(6):
a[i] = random.randint(1, 33)
for z in range(6):
a[z] = str(a[z])
delsp = random.randint(1, 16)
while shw:
serv = int(input('输入服务:1-自选,2-机选,3-退出:'))
if serv == 1:
for i in range(1, 7):
l[i - 1] = input('请输入第%d个红号:' % i)
selsp = input('请输入蓝号:')
drw = 12 - len(set(a + l))
la = (' '.join(a)) + '+' + str(delsp)
print('开奖号码是:%s' % la)
if drw and drw != 6:
if delsp == selsp:
print('你中了%d + 1个号码!' % drw)
else:
print('你中了%d个号码!' % drw)
elif drw == 6 and selsp == delsp:
print('恭喜你,全都中了!')
else:
print('很可惜,你没有中!')
elif serv == 2:
p = []
for i in range(1, 7):
s = [str(random.randint(1, 33)), str(random.randint(1, 33)), str(random.randint(1, 33)), str(random.randint(1, 33))\
, str(random.randint(1, 33)), str(random.randint(1, 33))]
while len(s) != len(set(s)):
s = [str(random.randint(1, 33)), str(random.randint(1, 33)), str(random.randint(1, 33)), str(random.randint(1, 33))\
, str(random.randint(1, 33)), str(random.randint(1, 33))]
p.append(s)
r = (' '.join(s)) + '+' + str(random.randint(1, 16))
print('%d - %s' % (i, r))
lu = int(input('选择第几组?'))
c = p[lu - 1]
drw = 12 - len(set(a + c))
for s in range(6):
a[s] = str(a[s])
la = (' '.join(a)) + '+' + str(delsp)
print('开奖号码是:%s' % la)
if drw and drw != 6:
if delsp == selsp:
print('你中了%d + 1个号码!' % drw)
else:
print('你中了%d个号码!' % drw)
elif drw == 6 and selsp == delsp:
print('恭喜你,全都中了!')
else:
print('很可惜,你没有中!')
elif serv == 3:
shw = False
else:
print('输入错误')
for i in range(6):
a[i] = random.randint(1, 33)
while len(a) != len(set(a)):
for i in range(6):
a[i] = random.randint(1, 33)
delsp = random.randint(1, 16)
s = input('请输入账号:')
v = input('请输入密码:')
if s == 'bilibili' and v == '28372':
print('\n\n\n\n\n\n\n\n\n\n\n\n\n\n')
main()
else:
print('错误')