我在第37行遇到问题,我尝试在一行上输入一组打印语句。一个告诉你一些事情,一个带有选择语句,另一个带着变量enemy11。我怎样才能在一行上打印所有内容?
此外,随机选择,说它选择拳打,我怎么能检测到,所以我可以把它从你的健康?所以它选择了一拳。它承认它被打孔并从HP中消失。
hp=100
enemy1=100
enemy2=200
boss=500
punch=10
kick=20
fatality=99999999
attacks = ['kick', 'punch', 'fatality']
from random import choice
from time import sleep
print("Welcome to Ultimate Fight Club Plus")
sleep(1)
print("What is your name?")
name=raw_input("> ")
print("Good luck"), name
sleep(1)
print("Choose your opponent")
enemy11=raw_input("> ")
print("You chose"), enemy11
sleep(1)
print("his health is"), enemy1
sleep(1)
print("Fight!")
while enemy1>1:
print("You can kick or punch")
fight1=raw_input("> ")
if fight1=="punch":
enemy1 -= punch
print("You punch him in the face")
sleep(1)
print("His health is now"), enemy1
sleep(1)
print(enemy11) print choice(attacks) print("You")
if fight1=="kick":
enemy1 -= kick
print("You kick him.")
sleep(1)
print("His health is now"), enemy1
print("You win!")