change server to enable debug and not output body output getting very long

This commit is contained in:
2024-04-12 23:10:00 +02:00
parent 5e63d0b35e
commit 3aec07a7e7
3 changed files with 4 additions and 2 deletions
+1
View File
@@ -4,3 +4,4 @@ from snakes.AStarSnake import AStarSnake
from snakes.MasterSnake import MasterSnake from snakes.MasterSnake import MasterSnake
SNAKE = MasterSnake() SNAKE = MasterSnake()
DEBUG = True
+1 -1
View File
@@ -45,7 +45,7 @@ def start(game_state: typing.Dict):
def move(game_state: typing.Dict) -> typing.Dict: def move(game_state: typing.Dict) -> typing.Dict:
next_move = SNAKE.choose_move(game_state) next_move = SNAKE.choose_move(game_state)
game_state_storage.add_moves(game_state["board"], next_move) game_state_storage.add_moves(game_state["board"], next_move)
print("MOVE:", f"{next_move},", "Me:", {"body": game_state["you"]["body"], "head": game_state["you"]["head"], "length": game_state["you"]["length"]}) print("MOVE:", f"{next_move:5},", "Me:", {"head": game_state["you"]["head"], "length": game_state["you"]["length"]})
return {"move": next_move} return {"move": next_move}
# end is called when your Battlesnake finishes a game # end is called when your Battlesnake finishes a game
+2 -1
View File
@@ -2,6 +2,7 @@ import logging
import os import os
import typing import typing
from config import DEBUG
from flask import Flask from flask import Flask
from flask import request from flask import request
@@ -42,4 +43,4 @@ def run_server(handlers: typing.Dict):
logging.getLogger("werkzeug").setLevel(logging.ERROR) logging.getLogger("werkzeug").setLevel(logging.ERROR)
print(f"\nRunning Battlesnake at http://{host}:{port}") print(f"\nRunning Battlesnake at http://{host}:{port}")
app.run(host=host, port=port) app.run(host=host, port=port, debug=DEBUG)