为什么我运行这个时什么都没有发生?
选择 | 换行 | 行号
- from sys import exit
- from random import randint
- def main_hall():
- print "You are on the war ship. You need to get into the elevator to get to the bridge; where the General is."
- print "The whole destroyer is on alert and nearly every door is locked. There is a keypad on the elevator."
- print "There is a warning saying you only have 10 attemps, then the system deactivates and you cannot complete your mission. Be careful!"
- combination = "%d%d%d" % (randint(1,9), randint(1,9), randint(1,9))
- guess = raw_input ("[Keypad:] ")
- guesses = 0
- while guess != combination and guesses < 10:
- print "*BZZT!* ERROR 2355: Incorrect combination!"
- guesses += 1
- guess = raw_input
- if guess == combination:
- print "You open the elevator and start going up, fast. When you get to the top, you are at a T-junction. Do you go left or right?"
- return 'junction'
- else:
- print "You have had more than 10 attempts! \n A small self destruct system in the lock blows you up!\n"
- return 'death'
- def death():
- lols = ["NO! You have failed this mission!", "Game over kid!", "You are really bad.", "Mission over, you may aswell go home."]
- print lols(0, len(lols)-1)
- exit (1)
这是我的游戏版本。我这样做是为了一个学习python的练习,一个书本教程。为什么什么都没有发生?没有错误消息,只是什么都没有发生……谢谢!