我使用trinket.io 编写了一个相当大的代码。后来我做了一个商店,然后是一个保存功能。有一次,我做了一个保存功能,代码停止工作。
我已经尝试修复缩进修复拼写错误将代码放入新的 python 程序。
def main():
reward = 0
patt = 20
pdef = 10
php = 35
pgold= 0
pgold = pgold + reward
name = input("what is your name")
print('''You are ''' +name+ ''' and you're trying to escape from the zoo but OUTTA NOWHERE A...''')
save()
def save():
import random
import time
name = input("what is your name")
print('''You are ''' +name+ ''' and you're trying to escape from the zoo but OUTTA NOWHERE A...''')
number1 = random.randint(1,7)
if number1 == 1:
spawn = ' Monkey God'
satt = 1000
sdef = 9999
shp = 1000000
elif number1 == 2:
spawn = ' Howard the alien'
satt = 0
sdef = 1
shp = 1
elif number1 == 3:
spawn = ' Evan'
satt = random.randint(4,21)
sdef = random.randint(21,99)
shp = random.randint(1,50)
elif number1 == 4:
spawn = ' Game Katana'
satt = random.randint(1,500)
sdef = random.randint(4,25)
shp = random.randint(5,25)
elif number1 == 5:
spawn = ' John Cena'
satt = 50
sdef = random.randint(1,42)
shp = 25
elif number1 == 6:
spawn = ' Willy Wonka'
satt = random.randint(1,50)
sdef = random.randint(1,50)
shp = random.randint(1,50)
else:
spawn = ' Jax'
satt = random.randint(1,25)
sdef = random.randint(1,25)
shp = random.randint(1,25)
number2 = random.randint(1,4)
if number2 == 1:
adj = 'cringey'
satt = satt -25
elif number2 == 2:
adj = 'OP'
sdef = sdef +40
elif number2 == 3:
adj = 'demonic'
shp = shp +30
else:
adj = 'angelic'
sdef = sdef +3
print ('random ' +adj + spawn+ ' appeared!')
我希望代码能够运行并显示一些东西,即使它有问题我可以解决这个问题,但是,我想工作。(而且我在编码方面真的非常非常糟糕。所以请记住这一点。)
Cats萌萌
不负相思意
相关分类