def log_state(state): if config.interactive: print(state) input() if config.save_replay: replay['states'].append(copy.deepcopy(state))