#coding=utf-8from sys import exit
defdog_room(dog):
play =raw_input("would you play the dog?")if"head"in play :for i inrange(1,6):print"you play the dog's head %d time"% i
dog =int(dog)+1
fight =raw_input("Do you want to fight with god? or no?")if fight =="yes":
fight_god(dog)else:
dog_room(dog)elif"tail"in play:
dead("dog bite you")else:print"you can play head or tail"
dog_room(dog)deftiger_room(dog):
hungry =TruewhileTrue:
do =raw_input("there is a tiger in front of the door,you would ?")if"flee"in do:
start(dog)elif"give meat"in do:
hungry = false
elif"move"in do:if hungry:
dead("tiger eat you")else:
dog_room(dog)else:print"you can flee 、give meat or move"
tiger_room(dog)deffight_god(dog):if dog >=3:print"you kill the god,you are winner"
exit(0)else:
tiger_room(dog)defstart(dog):print"now we have two room"
room =raw_input("please select a room:")if room =="dog":
dog_room(dog)elif room =="tiger":
tiger_room(dog)else:print"you must select dog or tiger"
start(dog)defdead(why):print why,"good job!"
exit(0)
start(2)