#NEWLINE# def play( ) : #NEWLINE# #INDENT# world . load_tiles ( ) #NEWLINE# player = Player ( ) #NEWLINE# room = world . tile_exists ( player . location_x , player . location_y ) #NEWLINE# print ( room . intro_text ( ) ) #NEWLINE# while ( player . is_alive ( ) and ( not player . victory ) ) : #NEWLINE# #INDENT# room = world . tile_exists ( player . location_x , player . location_y ) #NEWLINE# room . modify_player ( player ) #NEWLINE# if ( player . is_alive ( ) and ( not player . victory ) ) : #NEWLINE# #INDENT# print ( 'Choose an action:\n' ) #NEWLINE# available_actions = room . available_actions ( ) #NEWLINE# for action in available_actions : #NEWLINE# #INDENT# print ( action ) #NEWLINE# #UNINDENT# action_input = input ( 'Action: ' ) #NEWLINE# for action in available_actions : #NEWLINE# #INDENT# if ( action_input == action . hotkey ) : #NEWLINE# #INDENT# player . do_action ( action , ** action . kwargs ) #NEWLINE# break