ooms = []
for i in range(10):
if randint(0, 1):#這裡不會用
room = Room(i, Tiger(200))
else:
room = Room(i, Sheep(100))
rooms.append(room)
for new in rooms:
print(new.room_animal.animal_name )#包了三層
startTime = time.time()
while True:
endTime = time.time()
if (endTime - startTime) > 180:
print('\n\n==========Game Over==========\n\n')
game_room = randint(1, 10) # 用于显示房间号
roomNo = rooms[game_room - 1]
userChose1 = input(f'当前是{game_room}房间,要敲房门吗?[y/n]')
if userChose1 == 'y':
roomNo.room_animal.roar()
userChose2 = input(f'请给动物投食: [meat/grass]')
roomNo.room_animal.feed(userChose2.strip())