def create_snake_environment(level_filename): """ Create a new Snake environment from the config file. """ with open(level_filename) as cfg: env_config = json.load(cfg) return Environment(config=env_config, verbose=1)
def load_env(name): with open(get_env_config_file(name)) as cfg: env_config = json.load(cfg) return Environment(config=env_config, verbose=0)