用户:
王者在这里查看:0 回复:0 评论:0 创建时间:2021-12-05T19:53:04
【作品展示】

【作品介绍】
1
【作品源代码】
import random
a=input("请选择您要的战机(自然选择号/蓝色空间号/万有引力号)")
if a == "自然选择号":
c = random.randint(50, 100)
a = random.randint(10,20)
d = random.randint(5, 9)
h = int(100)
print("你的体力为" + str(c))
print("你的攻击为" + str(a))
print("你的防御为" + str(d))
while True:
g = input("你现在可以竞争,升级,抽奖")
if g == "升级":
print("你的能量为"+str(h))
s = int(input("请问你要升几级"))
if s < h:
c = c+s
a = a+s
d = d+s
h = h-s
print("你的体力为" + str(c))
print("你的攻击为" + str(e))
print("你的防御为" + str(d))
print("你的能量为"+str(h))
else:
print('你的能量不足')
if g == "竞争":
cc = random.randint(10, 40)
ee = random.randint(0, 100)
喵 = random.randint(5, 9)
print("对方的体力为" + str(cc))
print("对方的攻击为" + str(ee))
print("对方的防御为" + str(喵))
ee = input("你是否要竞争(要/不要)")
if ee == "要":
print("你正在与他厮杀")
if cc-(e-喵)*3 < 0 or c-(ee-d) > 0:
print("你赢了")
h = h+10
else:
print("你输了")
if g == "抽奖":
i = input("请问你要抽什么奖(铜奖/银奖/金奖)")
if i == "铜奖":
l = input("要花费80能量,你要抽吗?(要/不要)")
if l == "要" or h > 80:
h = h-80
ll = random.randint(50, 123)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
if i == "银奖":
l = input("要花费120能量,你要抽吗?(要/不要)")
if l == "要" or h > 120:
h = h-120
ll = random.randint(80, 160)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
if i == "金奖":
l = input("要花费160能量,你要抽吗?(要/不要)")
if l == "要" or h > 80:
h = h-80
ll = random.randint(100, 250)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
if a == "蓝色空间号":
c = random.randint(5, 50)
e = random.randint(1, 20)
d = random.randint(5, 900)
h = int(100)
print("你的体力为" + str(c))
print("你的攻击为" + str(e))
print("你的防御为" + str(d))
while True:
g = input("你现在可以竞争,升级,抽奖")
if g == "升级":
print("你的能量为"+str(h))
s = int(input("请问你要升几级"))
if s < h:
c = c+s
e = e+s
d = d+s
h = h-s
print("你的体力为" + str(c))
print("你的攻击为" + str(e))
print("你的防御为" + str(d))
print("你的能量为"+str(h))
else:
print('你的能量不足')
if g == "竞争":
cc = random.randint(10, 40)
ee = random.randint(0, 100)
喵 = random.randint(5, 9)
print("对方的体力为" + str(cc))
print("对方的攻击为" + str(ee))
print("对方的防御为" + str(喵))
ee=input("你是否要竞争(要/不要)")
if ee=="要":
print("你正在与他厮杀")
if cc-(e-喵)*3<0 or c-(ee-d)*3>0:
print("你赢了")
h=h+10
else:
print("你输了")
if g == "抽奖":
i=input("请问你要抽什么奖(铜奖/银奖/金奖)")
if i=="铜奖":
l=input("要花费80能量,你要抽吗?(要/不要)")
if l=="要"or h>80:
h=h-80
ll = random.randint(50, 123)
print("你中了"+str(ll)+"能量")
h=h+ll
else:
print("你的能量不足")
if i == "银奖":
l = input("要花费120能量,你要抽吗?(要/不要)")
if l == "要" or h > 120:
h = h-120
ll = random.randint(80, 160)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
if i == "金奖":
l = input("要花费160能量,你要抽吗?(要/不要)")
if l == "要" or h > 160:
h = h-160
ll = random.randint(100, 250)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
if a == "万有引力号":
c = random.randint(5, 50)
e = random.randint(1, 200)
d = random.randint(5, 90)
h = int(100)
print("你的体力为" + str(c))
print("你的攻击为" + str(e))
print("你的防御为" + str(d))
while True:
g = input("你现在可以竞争,升级,抽奖")
if g == "升级":
print("你的能量为"+str(h))
s = int(input("请问你要升几级"))
if s < h:
c = c+s
e = e+s
d = d+s
h = h-s
print("你的体力为" + str(c))
print("你的攻击为" + str(e))
print("你的防御为" + str(d))
print("你的能量为"+str(h))
else:
print('你的能量不足')
if g == "竞争":
cc = random.randint(10, 40)
ee = random.randint(0, 100)
喵 = random.randint(5, 9)
print("对方的体力为" + str(cc))
print("对方的攻击为" + str(ee))
print("对方的防御为" + str(喵))
ee = input("你是否要竞争(要/不要)")
if ee == "要":
print("你正在与他厮杀")
if cc-(e-喵)*3 < 0 or c-(ee-d) > 0:
print("你赢了")
h = h+10
else:
print("你输了")
if g == "抽奖":
i = input("请问你要抽什么奖(铜奖/银奖/金奖)")
if i == "铜奖":
l = input("要花费80能量,你要抽吗?(要/不要)")
if l == "要" or h > 80:
h = h-80
ll = random.randint(50, 123)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
if i == "银奖":
l = input("要花费120能量,你要抽吗?(要/不要)")
if l == "要" or h > 120:
h = h-120
ll = random.randint(80, 160)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
if i == "金奖":
l = input("要花费160能量,你要抽吗?(要/不要)")
if l == "要" or h > 80:
h = h-80
ll = random.randint(100, 250)
print("你中了"+str(ll)+"能量")
h = h+ll
else:
print("你的能量不足")
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn