
Lv.1
()
签名:写代码()()() 玩起床()()() 什(
在 【Python教程连续剧--3】超简单文字游戏了解一下?(doge) 中回复
我来交作业!
drxl = int(input('敌方的血量是?'))
drgj = int(input('敌方的攻击是?'))
wfxl = int(input('我方的血量是?'))
wfgj = int(input('我方的攻击是?'))
while (drxl > 0 and wfxl > 0):
drxl = (drxl - wfgj)
wfxl = (wfxl - drgj)
print(('敌方血量' + str(drxl)))
print(('我方血量' + str(wfxl)))
if (wfxl <= 0):
if (drxl <= 0):
print('平局')
else:
print('我方胜利')
else:
print('敌方胜利')
2021-07-24T16:29:45 点赞:1
在 假【Python作品分享】妖怪对决 中回复
源代码:
import random
ygxl = 100
wfxl = 100
print('你来到了妖怪的老巢')
print('要想从这里过去,必须打败妖怪!')
jn = ['一墨横空', '墨渡迷津', '墨之纵横', '墨下乾坤']
wl = [12, 15, 17, 20]
print('输入100使用普通攻击')
for i in range(4):
print(((('输入' + str(i)) + '使用') + jn[i]))
while 1:
if (wfxl > 0 and ygxl > 0):
n = int(input('请输入数字,使用技能或普通攻击,攻击妖怪 '))
if (n == 100):
wfgj = random.randint(5, 27)
yggj = random.randint(5, 30)
ygxl = (ygxl - wfgj)
wfxl = (wfxl - yggj)
print((((('你对妖怪造成了' + str(wfgj)) + '点伤害,你还有') + str(wfxl)) + '点血'))
print((((('妖怪对你造成了' + str(yggj)) + '点伤害,妖怪还有') + str(wfxl)) + '点血'))
elif (n == 0 or n == 1 or n == 2 or n == 3):
ygxl = (ygxl - wl[n])
print((((('你对妖怪造成了' + str(wl[n])) + '点伤害,妖怪还有') + str(ygxl)) + '点血'))
yggj = random.randint(1, 20)
wfxl = (wfxl - yggj)
print((((('妖怪对你造成了' + str(yggj)) + '点伤害,你还有') + str(wfxl)) + '点血'))
else:
print('输入数字来攻击!!!,请重启程序')
break
elif (wfxl <= 0 and ygxl <= 0):
print('平局')
break
elif (wfxl <= 0 and ygxl > 0):
print('你死了')
break
else:
print('恭喜击败妖怪')
break
2021-07-26T19:09:48 点赞:0
在 【关于神射手事件】辩论,站队和阴谋论 中回复
"最聪明,最会使用科技工具,甚至“破坏力”最强少儿社区“说的好!!!!
举个例子
看看这个帖子:https://shequ.codemao.cn/community/391293
2021-08-10T10:55:55 点赞:0
在 求助速建() 中回复
//@飞熊这才是正确代码
//速建一片草地(修改了“,”,修改了“Voxel.setVoxel(x, 8, z, 'grass')”)
for(let x=0;x<150;x++){
for(let z=0;z<150;z++){
voxels.setVoxel(x, 8, z, 'grass')
}
}
//挖掉上面三格深的方块
for(let x=0;x<150;x++){
for(let y=3;y>0;y--){
for(let z=0;z<150;z++){
voxels.setVoxel(x, y, z, '')
}
}
}2021-08-28T12:08:05 点赞:0