0
import random
import time
def header():
printNow("The program is starting now, prepare to be slain")
monsterTest();
def monsterTest():
for i in range(0,1):
currentHp = 99;
printNow("Starting Health is: "+str(currentHp))
randomHit = random.randint(0,50)
attack1 = currentHp - randomHit
printNow("Monster attacks for: "+str(randomHit))
printNow("Remaining Health is: "+str(currentHp-randomHit))
battle1 = attack1
printNow(">>>")
printNow("Next Attack Incoming!")
printNow(">>>")
time.sleep(1.5)
currentHp = battle1
printNow("Current Health is: "+str(currentHp))
attack2 = currentHp - randomHit
printNow("Monster attacks again for: "+str(attack2))
battle2 = currentHp - attack2
printNow("After That we are left with "+str(battle2)+" HP")
footer();
def footer():
printNow(">>>")
printNow("Thank you for using Cidadel's Battle Simulator, this concludes our test...")
printNow(header())
The program is starting now, prepare to be slain
Starting Health is: 99
Monster attacks for: 38
Remaining Health is: 61
>>>
Next Attack Incoming!
>>>
Current Health is: 61
Monster attacks again for: 23
After that we are left with 38 HP
>>>
Thank you for using Citadel's Battle Simulator, this concludes our test...
*None*
>>>
爲什麼我會得到這個沒有,我認爲這與我的printNow命令做的,但我不知道我在做什麼錯誤使實際無值..:/爲什麼我得到None的值?
我試圖只是運行正常,但我始終得到無值我上去列表註釋掉我行
什麼是'printNow()'? – IanAuld 2014-10-16 23:57:49