else: direction = random.choice(list(dir_map.keys())) send_and_receive(dir_map[direction]) # if game_state.can_move_direction(direction): # action_str += " Moving %s..." % direction # send_and_receive(dir_map[direction]) # elif game_state.can_open_door(direction): # action_str += " Opening %s door..." % direction # send_and_receive(dir_map[direction]) # elif game_state.can_attack_monster(direction): # action_str += " Attacking monster %s..." % direction # send_and_receive(dir_map[direction]) # else: # continue if game_state.agent_just_leveled_up(): print("Woohooo we leveled up!!!!!!!!") send_input('\r') if game_state.is_agent_too_terrified(): print("FIX ME") time.sleep(10) if game_state.agent_cannot_move(): print("FIX ME") time.sleep(10) if game_state.has_agent_died(): print("******* AW MAN ... WE DIED ***********") time.sleep(1) send_input('\r')