diff --git a/.gitignore b/.gitignore index 9667085..1aee748 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ .vscode .venv/ __pycache__/ -history/ +data/ diff --git a/main.py b/main.py index 5db1cc7..b62a0f7 100644 --- a/main.py +++ b/main.py @@ -19,7 +19,7 @@ import json, os # and controls your Battlesnake's appearance # TIP: If you open your Battlesnake URL in a browser you should see this data def info() -> typing.Dict: - CONFIG_PATH = os.path.join(os.path.dirname(__file__), 'snake-config.json') + CONFIG_PATH = os.path.join(os.path.dirname(__file__), 'data', 'snake-config.json') snake = read_file(CONFIG_PATH, json.load) if not snake: snake = {"apiversion":"1","author":"","color":"#888888","head":"default","tail":"default"} @@ -37,7 +37,7 @@ def start(game_state: typing.Dict): # end is called when your Battlesnake finishes a game def end(game_state: typing.Dict): - HISTORY_PATH = os.path.join(os.path.dirname(__file__), 'history') + HISTORY_PATH = os.path.join(os.path.dirname(__file__), 'dataa', 'history') save_file(os.path.join(HISTORY_PATH, f"{SNAKE.__class__.__name__}-{game_state['game']['id']}.json"), SNAKE.get_history(), callback=json.dump, ensure_ascii=False)