笔者初学python,编写了一个小游戏进行参数传递练习,文字描述部分稍显简陋,还请见谅,现将代码贴上。
Map.py
class master_bedroom():
def __init__():
print 'The masterbedroom is large and beautiful. It is my mother\'s room,'
print 'A large bed takes most of the space of the room. A ipad is lying'
print 'on her bed. At the corner, a wooden door is closed.'
def operation():
while True:
action = raw_input(">")
if 'door' in action:
return 'dinning_hall_saloon'
break
else:
print 'do something.'
class dinning_hall_saloon():
def __init__():
print 'The dinning hall is the place we have meal everyday.On the table,'
print 'there are many items, such as wine ,egg, tea....There are three doors'
print 'here.