#Initialise#set up dictionariesMAP = {'foyer_forward':'back door','foyer_right':'lounge','foyer_backward':'front door','foyer_left':'bedroom','bedroom_right':'foyer', 'front door_forward':'foyer'}DESC = {'foyer':'You are in the foyer. It is dark and scary. You want to get out! ','back door':'Congratulations, you have escaped via the back door! ','bedroom':'You are in the bedroom. It has been redecorated.','lounge':'You are in the loungeroom. Carpet covers broken boards. You fall through.','front door':'The front door is locked!'}#set up list of items that end the gameFINISH = ['back door','lounge','quit' ]#starting locationroom = 'foyer'#Start of game codename = input('What is your name? ')print ('Hello',name)#loops continuously until a break. Note capital letter in boolean value TruewhileTrue:print (DESC[room])if room in FINISH:break direction = input( 'Enter a direction? Choose from forward, backward, left, right or quit ')if direction in FINISH:break key = room + '_' + directionif key in MAP: room = MAP[key]else :print ('You can\'t go ' +direction+'. ' )print ('Game over!')